OpenLayers unable to render Float32 GeoTiff
Describe the bug In this troubleshooting scenario we have 2 files.
-
One that works ( 'example.tif' ), downloaded from the OpenLayers documentation examples.
-
And then we have our file ( 'A60.tif' ), that doesn't work.
When trying to add the GeoTiff by URL in OpenLayers 9.0.0, using the COG examples in the OpenLayers documentation as a base, the layer is added but rendering is broken.
The 'A60.tif' GeoTiff file opens and renders in QGIS and the Leaflet tool ( http://app.geotiff.io/ ) just fine.
But when trying to add it as a source GeoTIFF as a TileLayer to OpenLayers in the same way as the method used in the OpenLayers documentation. It does not render as if it is being loaded incorrectly,
To Reproduce Steps to reproduce the behavior:
- Go to https://codesandbox.io/p/devbox/geotiff-labs-yrsjk3?file=%2Fsrc%2Findex.html
- Below the map, i have added the NDVI data return values from 'pointermove'. It is always
[ 0. 0 ]on theA60.tiffile that is unable to render.
Expected behavior As the GeoTiff files are added in the exact same way, i was expecting them both to work.
Since one works, and the other does not, with the documentation mentioning anything about GeoTiff requirements, i was hoping someone here would take a look at it.
i have included the files in question to this issue. tifs.zip
It may be because it uses a ModelTransformation. I attempted to use the file with the full build from #15402 deploy preview but that is currently not available.
#15402 will fix this:
Note that the file is not handled correctly by http://app.geotiff.io/ as the image is misplaced and inverted:
Also you need to specify normalize: false, in your source settings to use float values in your style.
Thanks for the tip. For now we will flip our y-axis before saving the data to GeoTiff.
Closing issue as #15402 will fix this.
Thanks for the response @mike-000