mapbox / tippecanoe

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

Support priority attribute for dropping #592

Open stevage opened 6 years ago

stevage commented 6 years ago

There are several mechanisms in Tippecanoe to determine which features to drop when necessary (smallest? densest? random?). For greater control, though, it would be handy to prepare the data to add some "priority" value to each feature, then do something like:

tippecanoe -rg --priority-attribute=priority ...

Then, whenever Tippecanoe needed to drop X features within a tile, it would sort them by the priority column, and drop those with the lowest value first.

e-n-f commented 6 years ago

I need to think this through some more, but I think it might be practical to implement if the priority were treated as a weight rather than as an absolute priority, so a feature with priority of 3 would only be 1/3 as likely to be dropped as other features.

stevage commented 6 years ago

Ah, that's interesting. I guess one could kind of use that system to achieve absolute priorities by using a scale like 1, 10, 100, 1000 etc instead of 1,2,3,4.

dkegle commented 5 years ago

I've also encountered this problem where features need to be dropped according to some priority. Has anything moved forward with respect to this? What are the alternatives for handling this situation?

csandor commented 1 year ago

Tippecanoers, we would be ready to sponsor this feature, if there was a developer willing to deal with it. Let me know!