[GRASS-user] cog float32 export smaller scale missing tiles

Martin Landa landa.martin at gmail.com
Mon Feb 22 06:37:26 PST 2021


Dear all,

I am facing to a strange problem when exporting floating-point raster
data into COG format using GDAL 3.2.1 and GRASS 7.8.5.

Attempt to export raster data by `r.out.gdal format=COG` including
color table fails from obvious reasons:

ERROR 1: pm_filled_map.tif: Unable to export color table to GeoTIFF
file.  Color tables can only be written to 1 band or 2 bands Byte or
UInt16 GeoTIFF files.

GDAL says:

Band 1 Block=512x512 Type=Float32, ColorInterp=Palette
Metadata:
    COLOR_TABLE_RULES_COUNT=3
...

QGIS loads data with invalid symbology (which can be easily "fixed" by
"Classify" button in the "Symbology" tab).

So far understandable. Data exported with `-c` and `-m` flags leads to
a grayscale color interpretation.

Band 1 Block=512x512 Type=Float32, ColorInterp=Gray

BUT after loading a COG file into QGIS no data is displayed! But if I
zoom in, the data is magically shown! Originally I thought that it's
caused by a broken symbology. But it seems that COG file does not have
tiles for smaller scales (identify tool reports no-data for whole AOI
on smaller scales). If I create a regular GeoTIFF file the problem
with zooming disappears.

Another strange thing is that COG file created without `-c` and `-m`
flags do not have problems with zoom levels.

Any idea what could be wrong?

Thanks in advance! Martin

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa


More information about the grass-user mailing list