systemed / tilemaker

Make OpenStreetMap vector tiles without the stack
https://tilemaker.org/
Other
1.44k stars 229 forks source link

Vector tile generation faulty in edge cases ? #574

Closed geoneutrino closed 10 months ago

geoneutrino commented 10 months ago

Hello, we observe a strange rendering error when using static maps rendering (tileserver-gl + maplibre-native. Using maplibre-js doesn't show this effect) with some regions. E.g the venetian lagoon https://www.openstreetmap.org/relation/3049430 is a complex multipolygon Generating (e.g. with the italy nord-est extract of geofabrik) with the openmaptiles or our own process.lua results in certain tiles to be "flooded" when painting. Discussed in maplibre native Project https://github.com/maplibre/maplibre-native/issues/1843 the first findings point to vectortile geometry not being correct (last comment of acalcutt loading geojson into google earth https://github.com/maplibre/maplibre-native/issues/1843#issuecomment-1799310359)

Now the questions is if this is an edge case where tilemaker is creating problematic geometries or not (there are other locations where this happens too like a tile in Copenhagen). Tests without simplify in config.json as well as using clipIncompleteEntities=true to pre-process the pbf didnt change anything

xvfb-run -a /gis/maplibre-native/build/bin/mbgl-render --debug --style=style-omt.json --lat=45.446518 --lon=12.330183 --zoom=16 --width=4000 --height=4000 --output venice-4000-omt.png with style attached style-omt.json.txt

results in

4000-omt

systemed commented 10 months ago

The clipping algorithm that tilemaker uses does create lines around the border, but usually these are removed by the subsequent call to the geometry correction routine. It looks like that's failing in this case and that Maplibre is particularly sensitive to this. I'll look into it though I doubt it'll be a trivial fix.

systemed commented 10 months ago

575 should fix this - do try it and let me know if it works for you.

geoneutrino commented 10 months ago

Great :) Yes. this fixes both venice and copenhagen I don't have a "benchmark" because we are testing alot changes in the profile but on my dev server (128 GB Ram, 24 Cores), Europe took a couple of minutes (maybe 10-12) longer. Very acceptable to us

systemed commented 10 months ago

Excellent. I'll merge the fix as-is and look to see if I can refine performance later.