protomaps / PMTiles

Cloud-optimized + compressed single-file tile archives for vector and raster maps
https://protomaps.com/docs/pmtiles/
BSD 3-Clause "New" or "Revised" License
2.09k stars 124 forks source link

Smaller zoom levels "leaking" in at larger zoom levels #495

Open LukasBommes opened 1 day ago

LukasBommes commented 1 day ago

I noted visual artefacts at in our PMTiles as shown in the screenshots attached. To me it looks like that lower resolved overviews are "leaking in" at closer zoom levels. I observed this for mutiple differen PMTiles in PMTiles viewer and also in Openlayers (as in this example).

If it helps, I can anonymize my PMTile and provide it for debugging.

zoomed_out zoomed_in_1 zoomed_in_2

PMTiles were created from VRTs like this

gdal_translate in.vrt out.mbtiles -of MBTILES
gdaladdo -r bilinear out.mbtiles -minsize 256
pmtiles convert out.mbtiles out.pmtiles
bdon commented 1 day ago

have you experimented with generating a higher zoom level of mbtiles?

LukasBommes commented 2 hours ago

You mean higher than the "native" zoom level chosen by gdal_translate with default settings (BLOCKSIZE=256, TILE_FORMAT=PNG, ZLEVEL=6, ZOOM_LEVEL_STRATEGY=AUTO)?

I did try generating MBTiles with ZOOM_LEVEL_STRATEGY=UPPER but haven't analyzed the impact on the artefact yet. I can do so for debugging purposes. But adding an additional zoom level seems wasteful to me as it significantly increases size of the resulting PMTiles.

A (maybe) important detail to add: The artefact occurs at the tile grid boundary. This becomes evident when rendering the tile grid in OpenLayers as shown in this example. To me it looks like the renderer does not properly delete the lower-zoomlevel tile when rendering the higher zoom levels.