mapbox / mapnik-vector-tile

Mapnik implemention of Mapbox Vector Tile specification
BSD 3-Clause "New" or "Revised" License
554 stars 117 forks source link

Point simplification at low zoom levels? #267

Open mapsam opened 6 years ago

mapsam commented 6 years ago

For very large point datasets, it'd be great to build a path for simplifying them at low zoom levels like z0, z1, z2 to avoid huge individual tiles. I'm not sure what the best route is, but perhaps we can take a clue from Tippecanoe?

cc @flippmoke @ericfischer

e-n-f commented 6 years ago

The Tippecanoe mechanism is pretty straightforward if you want to adapt it:

The thing that will be hard if you're only working one tile at a time is to keep the features that are preserved consistent from one zoom to the next. Even without that, I think dropping in quadkey order will still tend to look better than random dropping (which develops clumps).

flippmoke commented 6 years ago

It is possible to write a custom algorithm to simplify multipoints I believe, but I think we might struggle to do this with sets of features. The reasoning for this is the current processing pipeline doesn't know about other features when simplification takes place. https://github.com/mapbox/mapnik-vector-tile/blob/master/src/vector_tile_geometry_simplifier.hpp#L32

e-n-f commented 6 years ago

I don't do anything special in Tippecanoe with MultiPoints (it either includes or drops the entire feature) but I probably should. I got into the habit of thinking that nobody used MultiPoint geometries because Mapnik would only render the first point (not sure if that's still true).