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

Add an updateColours method to allow for smooth colour updates of MS images. #53

Closed Rennzie closed 3 years ago

Rennzie commented 3 years ago

Is your feature request related to a problem? Please describe. Its frustrating that I need to invoke georaster.redraw() to update the colour of my multi-spectral map. It removes all tiles before redrawing showing a flash of blank screen before the image is updated.

Describe the solution you'd like Add an updateColours method that takes an updated pixelValuesToColorFn. This method should recolour the pixels with the new function.

Describe alternatives you've considered An alternative is to use the redraw() method of L.GridLayer however this is sub-optimal as describe above.

Additional context The motivation for such a feature is for setting dynamic thresholds on multi-spectral images. This will allow use cases where a user need to highlight certain parts of an image. In our case we use a historgram with range-sliders to set the thresholds on an NDVI map.

I'd be more than happy to put together a PR if there is interest for this feature. We are hoping to begin making use of COG's and this feature would be critical for it's success.

https://user-images.githubusercontent.com/32762874/102787159-888d8c80-4398-11eb-9502-68e5ec048903.mov

DanielJDufour commented 3 years ago

Thank you! This is a great issue to address.