Skip to content

Conversation

e-n-f
Copy link
Collaborator

@e-n-f e-n-f commented May 20, 2025

Tippecanoe's previous behavior with as-needed dropping or coalescing has been to treat features that share a representative point with some other feature as having infinite density, therefore being the first to be dropped or coalesced when the tile size needs to be reduced.

This interacts badly with some datasets that intentionally repeat geometries with different sets of attributes, expecting that the client will filter the features to show one set or another. In this case, only the first instance of each feature will be available if any features had to be dropped, leaving visible gaps if a filter instead tries to select one of the other copies.

This PR adds a new option, --distinguish-duplicates, which causes tippecanoe to recognize and to attempt to preserve duplicate feature locations. It will create up to 50 sub-layers of duplicate features within each layer, and features will be dropped or coalesced in their sub-layer's feature sequence instead of in the global feature sequence.

The new test's source file contains 60 copies apiece of three features A, B, and C. The output tiles contain 50 repeated blocks alternating A, B, and C (the detected duplicates), followed by blocks of the 10 remaining A features, the 10 remaining B features, and the 10 remaining C features.

@e-n-f e-n-f marked this pull request as ready for review May 21, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant