felt / tippecanoe

Build vector tilesets from large collections of GeoJSON features.
BSD 2-Clause "Simplified" License
875 stars 76 forks source link

Fix some undefined behavior #209

Closed e-n-f closed 5 months ago

e-n-f commented 5 months ago

The main point of this is to fix the division by 0 when there are no primary features in a tile, which is currently breaking the debug build (which this PR also reenables).

There are a few additional changes to fix the use of other undefined behaviors:

The last of these unfortunately ripples into many tests because of the slight changes to simplification decisions, which fortunately at least remain stable between ARM and x86.

One example of the simplification changes is visible in the overzoomed z0 tile of tippecanoe -zg -D10 -f -o after.mbtiles ne_10m_ocean.geojsonseq.json, before and after:

Screenshot 2024-02-29 at 12 36 54 PM Screenshot 2024-02-29 at 12 37 01 PM