Use reduce instead of foldLeft here:

```scala
nodes.reduce { (l, r) => getSafeUnionPolygon(l.polygon, r.polygon) }
```