I am trying to visualize a single band COG with OL and am loading the geotiff as:
const source = new ol.source.GeoTIFF({
sources: [
{
normalize: false,
// band 1 elevation
url: 'http://localhost/eu_dem_v22_itnord4326_cog512.tif',
min: 0,
max: 4711.0,
},
],
});
I then try to give the elevation some simple style:
const layer = new ol.layer.WebGLTile({
style: {
color: [
// omitted for readability
],
},
source: source,
});
but when I call the layer's getData method I always get an Uint8 array, which ranges between 0 and 255.
The geotiff's info using gdal/rio shows that the tiff is a float64. What is the proper way to get the float value from the layer?
normalize
is an option of the GeoTIFF, not of the sources
const source = new ol.source.GeoTIFF({
normalize: false,
sources: [
{
// band 1 elevation
url: 'http://localhost/eu_dem_v22_itnord4326_cog512.tif',
min: 0,
max: 4711.0,
},
],
});