GeoTIFF / georaster-layer-for-leaflet

Display GeoTIFFs and soon other types of raster on your Leaflet Map
https://geotiff.github.io/georaster-layer-for-leaflet-example/
Apache License 2.0
297 stars 58 forks source link

Overviews not showing properly for categorical map #96

Closed glaroc closed 1 year ago

glaroc commented 2 years ago

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

DanielJDufour commented 2 years ago

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

glaroc commented 2 years ago

Absolutely! It works like a charm now.

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

Thank you!