felt / tippecanoe

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

Fix accidental loss (at all zooms) of features with an explicit minzoom #221

Closed e-n-f closed 4 months ago

e-n-f commented 4 months ago

As reported in https://github.com/felt/tippecanoe/issues/219, versions of tippecanoe since 2.43.0 have accidentally dropped all features that specified an explicit minzoom with "tippecanoe":{"minzoom":nnn}. This PR adds an else clause to retain these features in the specified zoom range.

The test file is the Natural Earth 110m populated places, with the scalerank used as the minzoom. Each feature contains an object like this to specify its minzoom:

{"type":"Feature","tippecanoe":{"minzoom":8},"properties":{…},…}

The unrelated change to mbtiles.cpp and joined_reordered.json is to round the tileset bounding boxes and centers to six digits to avoid test failures on some platforms from slightly different floating point behavior.