Sunday, 13 October 2019

GRASS raster map types: UInt16 and Float64


i am in the processing of using r.out.gdal to export DEMs from GRASS into QGIS


this is the **output** of the **first** **try**: 
using **UInt16** as the data type.

r.out.gdal input=DEM0maslTopog@UTM_35S format=GTiff type=UInt16 "output=C:/Users/xxx/Documents/xxx/xxx/GIS/Working/UTM35S/DEM G2Q UInt16/0maslDEM G2Q UInt16 R2"


Exporting to GDAL data type: UInt16

Precision loss: Raster map of type DCELL to be exported as UInt16. This can be avoided by using Float64.

Checking GDAL data type and nodata value


Exporting to GDAL raster



r.out.gdal complete.
Successfully finished

Since the program suggests using Float64, this i try all to end up with error 6, which is not detailed in the GRASS manual (both in-Grass and at http://grass.osgeo.org/grass65/manuals/r.out.gdal.html): Output from Try 2


r.out.gdal input=DEM0maslTopog@UTM_35S format=GTiff type=Float64 "output=C:/Users/xxx/Documents/xxx/xxx/GIS/Working/UTM35S/DEM G2Q UInt16/0maslDEM G2Q Float64 R2"

Exporting to GDAL data type: Float64

Checking GDAL data type and nodata value


ERROR 6: SetColorTable() only supported for Byte or UInt16 bands in TIFF format.

Exporting to GDAL raster


r.out.gdal complete.
Successfully finished

my query: would the error impact significantly on the export (and results on subsequent DEM usage)


Bearing in mind that i would like to clip the DEMS to a vector area and use two DEMS (produced and exported in exactly the same way) to calculate volume.




Answer



The "ERROR 6: SetColorTable() only supported for Byte or UInt16 bands in TIFF format." comes from GDAL, not from GRASS GIS. It is caused by the limitation of GeoTIFF to handle color tables only for integer but not for floating point data.


So, the data are exported properly, just the color table could not be exported as well.


Maybe try a different format if that is of importance for you.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...