felt / tippecanoe

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

Fix bad interaction between dynamic dropping and limiting by truncation #260

Closed e-n-f closed 2 months ago

e-n-f commented 2 months ago

The safety checks added in https://github.com/felt/tippecanoe/pull/257 had another negative interaction of their own: when there were enough features in a tile that they hit the feature limit before they had all been deserialized, but there was also an abrupt feature limit set with --limit-tile-feature-count, it would still try to find features to drop dynamically, getting into a loop looking for them. Now when the abrupt limit is applied, it will stop looking for the graceful limit.

The new test demonstrates the problem by making a tile that has more features than the drop-as-needed feature count limit, which in turn is greater than the drop-abruptly feature limit. With recent versions of tippecanoe it would get stuck in a loop.