[GRASS-user] Error while exporting

Markus Metz markus.metz.giswork at googlemail.com
Tue May 17 05:40:09 EDT 2011


On Mon, May 16, 2011 at 3:32 PM, Monica Buescu
<monicabuescu1985 at gmail.com> wrote:
> I'm expericing a problem while trying to export a reclasses (r.reclass)
> raster map:
> I'm getting this error:
> Exporting to GDAL data type: Byte
> Checking GDAl data type and nodata value
> Selected GDAL datatype does not cover data range.
> GDAL datatype: Byte, range: 0 - 255
> Raster map <full_LULC at Regional> range: -2.14748e+009 - 20
> Raster export results in data loss.
> Input raster map contains cells with NULL-value (no-data). The value 255
> will be used to represent no-data values in the input map. You can specify a
> nodata value with the nodata option.
> ERROR: Raster export aborted.
>
> But If I try to export my original file (before reclass) It exports just
> fine.
> My reclass file is like this:
> 190 191 = 1
> 14 15 16 20 21 22 = 2
> 11 12 13 = 3
> 32 40 41 42 50 60 70 90 91 92 100 101 102 = 4
> 30 31 110 130 131 132 133 134 135 136 = 5
> 120 140 141 142 143 144 145 = 6
> 150 151 152 153 = 7
> 230 = 8
> 200 201 202 203 = 9
> 160 161 162 170 180 181 182 183 184 185 186 187 188 = 10
> 210 = 11
> 211 245= 20
> * = NULL
> What might be happening?

The NULL value of the reclass map is not recognized as NULL value, but
instead treated as a valid number.

This seems to be a bug in the GRASS library, specifically in
G_get_null_value_row() and has probably been around since GRASS 6.3.
r.out.gdal can easily be fixed by not using G_get_null_value_row().

I could reproduce it in nc_spm_08 with landclass96

echo "1 2 3 = 1
5 6 = 2
* = NULL" >reclass.rcl

r.reclass in=landclass96 out=my_landclass96 rules=reclass.rcl
# my_landclass96 is now a reclassified map of a reclassified map
r.out.gdal in=my_landclass96 out=my_landclass96.tif


More information about the grass-user mailing list