[Gdal-dev] GDAL error exporting grass raster to Gtiff

Dylan Beaudette dylan.beaudette at gmail.com
Wed Nov 8 13:38:17 EST 2006


On Wednesday 08 November 2006 09:11, Markus Neteler wrote:
> On Wed, Nov 08, 2006 at 09:08:37AM -0800, Dylan Beaudette wrote:
> ...
>
> > I wonder if there is a better way? The main problem lies in the fact that
> > r.out.gdal encodes GRASS NULL values as NaN, which doesn't seem to carry
> > over to other programs...
>
> Dylan,
>
> you mean that
>
> GRASS 6.3.cvs (spearfish60):~ > r.out.gdal input=slope format=AAIGrid
> type=Float32 output=slope.arc Writing format: AAIGrid
> Writing type:   Float32
> Input file size is 634, 478
> 0...10...20...30...40...50...60...70...80...90...100 - done.
>
> GRASS 6.3.cvs (spearfish60):~ > head slope.arc
> ncols        634
> nrows        478
> xllcorner    589980.000000000000
> yllcorner    4913690.000000000000
> cellsize     30.000000000000
> NODATA_value    nan
>     nan    nan    nan    nan
> [...]
>
> should be better a number instead of nan?
>
> Maybe it's a bug in the program since
>
>         if (datatype==GDT_Unknown) {
>                 /* ... determine raster data type from first GRASS raster
> in a group */ maptype = G_raster_map_type(ref.file[0].name,
> ref.file[0].mapset); if (     maptype==FCELL_TYPE) { datatype=GDT_Float32;
> nodataval = -1E37f; } else if (maptype==DCELL_TYPE) { datatype=GDT_Float64;
> nodataval = -1E37f; } else {                          datatype=GDT_Int32;  
> nodataval = (double)(int) 0x80000000; } }
>
> is conditionalized and won't be always picked up?
>
> Markus

Correct. Exporting to GeoTIFF results in the same type of problem. Is that 
source from the new r.out.gdal ?

thanks!

-- 
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341



More information about the Gdal-dev mailing list