[GRASS-user] Re: [GRASS-dev] gdal import an nodata cells

Frank Warmerdam warmerdam at pobox.com
Thu Jul 19 11:42:14 EDT 2007


Carlos "Guâno" Grohmann wrote:
> I just imported a DEM that was sent to to in Erdas IMG format (HFA),
> with r.in.gdal, and after importing I had to use r.mapcalc to make the
> NODATA cells -- which were tagged as -32768 -- became NULL.
> 
> I was just wondering if there is a way to do this automatically? can I
> pass the -32768 value as an option to r.in.gdal so the cell will be
> imported as null?

Carlos,

I don't see any options to provide a nodata on the r.in.gdal commandline,
but r.in.gdal will set pixels to null if GDAL "knows" the nodata value for
the source dataset.  Nodata support does exist now in the HFA (.img) driver
but I think it was recently introduced.  It is also possible that the nodata
value wasn't properly marked in the source .img file.

A commandline argument for this could be added to r.in.gdal, but given the
relative ease of fixing it up with r.mapcalc, I'm not sure it would be
worth the complication.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the grass-user mailing list