Opened 16 years ago

Closed 16 years ago

#67 closed defect (fixed)

r.out.gdal type= and no-data issues

Reported by: sieczka Owned by: martinl
Priority: critical Milestone: 6.3.0
Component: Default Version: unspecified
Keywords: gdal Cc: grass-dev@…, warmerdam
CPU: Unspecified Platform: Unspecified

Description

If data 'type' is not specified and the input raster has nulls, r.out.gdal picks a correct datatype automatically, but sets a bogus no-data value. Example, in spearfish60:

r.out.gdal in=geology out=gelogy.tif
Exporting to GDAL data type: Byte
 100%
WARNING: Input raster map constains cells with NULL-value (no-data). For
         no-data values was used value -2147483648. You can specify nodata
         value by nodata parameter.
r.out.gdal complete.

Note the bogus -2147483648 no-data value, not in Byte datatype range.

If the user specifies 'type=Byte' explicitely, r.out.gdal sets nodata to 255 by default (OK):

GRASS 6.3.svn (spearfish60):~ > r.out.gdal in=geology out=gelogy2.tif type=Byte
Exporting to GDAL data type: Byte
 100%
WARNING: Input raster map constains cells with NULL-value (no-data). For
         no-data values was used value 255. You can specify nodata value by
         nodata parameter.
r.out.gdal complete.

Attachments (1)

r-out-gdal-no-data.diff (821 bytes ) - added by martinl 16 years ago.
The attached patch should fix this issue.

Download all attachments as: .zip

Change History (6)

by martinl, 16 years ago

Attachment: r-out-gdal-no-data.diff added

The attached patch should fix this issue.

comment:1 by martinl, 16 years ago

Cc: grass-dev@… added
Keywords: gdal added
Owner: changed from grass-dev@… to martinl
Status: newassigned

Please test the attached patch. Martin

comment:2 by neteler, 16 years ago

Cc: warmerdam added

I darkly remember that GDAL uses out-of-range values for no data. Possible?

See also

http://lists.osgeo.org/pipermail/grass-dev/2007-May/031316.html

http://lists.osgeo.org/pipermail/grass-dev/2007-May/031715.html

Markus

in reply to:  2 comment:3 by martinl, 16 years ago

Replying to neteler:

I darkly remember that GDAL uses out-of-range values for no data. Possible?

See also

http://lists.osgeo.org/pipermail/grass-dev/2007-May/031316.html

http://lists.osgeo.org/pipermail/grass-dev/2007-May/031715.html

this should be already fixed, see r29555.

Martin

in reply to:  1 comment:4 by martinl, 16 years ago

Replying to martinl:

Please test the attached patch. Martin

Patch applied in trunk, r30433. Martin

comment:5 by martinl, 16 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.