georaster-layer-for-leaflet icon indicating copy to clipboard operation
georaster-layer-for-leaflet copied to clipboard

Overviews not showing properly for categorical map

Open glaroc opened this issue 3 years ago • 2 comments

I've generated a COG of a land cover (integer) map and hosted it on the cloud. I used gdalwarp with nearest resampling for the creation of the cog and the overviews. I used pixelValuesToColorFn to assign a distinct color for every land cover category. When loaded in georaster-layer-for-leaflet, there are "holes" of transparency in the map. It appears that the overviews contain interpolated values that don't correspond to one of the values of the raster. If I debug the pixelValuesToColorFn function, I see some values are passed to it that are not on the actual map. When I zoom in to have the tiles at the maximum resolution, all colors are ok.

See this screenshot Screenshot from 2022-05-12 16-31-28

When I load the same map from the URL in QGIS, I don't get this problem, at any zoom level. Screenshot from 2022-05-12 16-29-11

With v 3.7.2

glaroc avatar May 12 '22 20:05 glaroc

Hi. Does this link help? https://github.com/GeoTIFF/georaster-layer-for-leaflet/issues/86#issuecomment-974067073

DanielJDufour avatar May 12 '22 21:05 DanielJDufour

Absolutely! It works like a charm now.

I couldn't find a resampling option in the documentation. Is this documented somewhere ?

Thank you!

glaroc avatar May 12 '22 21:05 glaroc