georaster-layer-for-leaflet
georaster-layer-for-leaflet copied to clipboard
Auto-Visualize Separated Band Scene without pixelValuesToColorFn
Should be able to automatically visualize a scene with separated bands without specifying a pixelValuesToColorFn like we had to do here: https://github.com/GeoTIFF/georaster-layer-for-leaflet-example/blob/master/examples/separated.html#L45
The following changes are required:
- Need to update https://github.com/GeoTIFF/georaster-layer-for-leaflet/blob/master/src/georaster-layer-for-leaflet.ts#L144 so that an error isn't thrown when there are multiple georasters AND a total of 3 or 4 bands
- if passing in multiple georasters with a total of 3-4 bands and no mins/maxs and no pixelValuesToColorFn, automatically calculate running statistics for linear stretching in getColor
- https://github.com/GeoTIFF/georaster-layer-for-leaflet/issues/90
note: I'm suggesting we scale based on running statistics not the data type's min/max because scaling by data type's min/max doesn't look good for landsat and might not look good for other datasets as well. If people want to scale by the data type's min/max they can always over-ride it by passing in a pixelValuesToColorFn. Furthermore, at some point, I need to update the code to fetch and calc stats for all the tiles in the zoom level before running the rendering sequence. That way we avoid all no-data in the topleft tile messing up the rendering.