8000 What happened to --coalesce-densest-as-needed ? · Issue #330 · felt/tippecanoe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

What happened to --coalesce-densest-as-needed ? #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MTachon opened this issue Mar 31, 2025 · 2 comments
Open

What happened to --coalesce-densest-as-needed ? #330

MTachon opened this issue Mar 31, 2025 · 2 comments

Comments

@MTachon
Copy link
MTachon commented Mar 31, 2025

I use tippecanoe to generate vector tiles for ocean model outputs for visualization in a web browser. The grid of the ocean model is a triangulated irregular network, with smaller cell size close to the coastline. I have tested tippecanoe from both mapbox and felt for the following command:

tippecanoe -z13 -o my_features.mbtiles --include=field1 --accumulate-attribute=field1:mean --coalesce-densest-as-needed my_features.geojson -lmy_layer

I get two different outputs that are quite different (see the screenshots for the same area of an output tile below). The first one was obtained with the tippecanoe implementation from mapbox, and the second one was obtained with the tippecanoe fork from felt.

mapbox:

Image

felt:

Image

It looks like the coalescing algorithm from felt merges together the densest and adjacent features within an internal tiling scheme for each output tile. This leaves many small features unmerged close to the coastline, while other large features are getting merged together even though they are not the densest in the output tile. To me, the coalescing from the mapbox implementation is what users would expect: the coalescing uses the feature density on a per output tile basis, not based on an internal tiling scheme within each output tile. It may be a change that was introduced in felt's implementation to speed up the generation of the output tiles? Is there a way/parameter to control the features coalescing so that the tippecanoe implementation from felt behaves the same way as the implementation from mapbox does?

Thank you.

@e-n-f
Copy link
Collaborator
e-n-f commented Mar 31, 2025

Coalesce-densest has always worked in a sequence that amounts to a sub-tile structure within each tile; what has changed more recently is that the density calculation, instead of using just the quadkey distance between points, now takes into account the physical distance from the representative point for each feature to the most distant vertex of the adjacent feature. The reason for the change was to avoid treating large features (specifically Central Park in NYC) as being very close to any regular street block and getting coalesced into it, even though it is quite large and the coalescing would be very visible.

I can add an option to turn off this behavior, which was added in #247, if you can share a copy of your data so I can verify that it improves the appearance of your data set.

The other change that might have affected your dataset is #2, which changed the representative point for polygons to be one of their vertices instead of the center of their bounding boxes.

@MTachon
Copy link
Author
MTachon commented Apr 1, 2025

I understand. It may be that the coalescing behaviour happening in the case of Central Park in NYC you mentioned is what I expected when generating tiles for my data.
Here is a link for downloading some fake data with a typical grid we use for our modelling:
https://www.dropbox.com/scl/fi/zk4svzwieyy6d5tlurtj6/fake_data.geojson?rlkey=zt5gqewuug8kxr9ie495k1pxk&st=ceoocz24&dl=0

Thanks for the quick reply and for taking time investigating into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants
0