systemed / tilemaker

Make OpenStreetMap vector tiles without the stack
https://tilemaker.org/
Other
1.42k stars 228 forks source link

Centroid(...) should return nil on error #649

Closed cldellow closed 7 months ago

cldellow commented 7 months ago

Previously, calling Centroid(...) on an invalid geometry (such as https://www.openstreetmap.org/relation/9769005, which I think gets simplified to having 0 rings) would throw, killing the lua process.

Instead, return nil.

I think this is reasonable? I guess it might be preferable if invalid geometries never made it to the lua code, but then we'd have to proactively fix every geometry, even those not ultimately emitted, which would be expensive.

systemed commented 7 months ago

Good spot! Thanks.