[GRASS-SVN] r30433 - grass/trunk/raster/r.out.gdal

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 3 03:29:35 EST 2008


Author: martinl
Date: 2008-03-03 03:29:35 -0500 (Mon, 03 Mar 2008)
New Revision: 30433

Modified:
   grass/trunk/raster/r.out.gdal/main.c
Log:
r.out.gdal: fixing type= and no-data issues (trac #67)

Modified: grass/trunk/raster/r.out.gdal/main.c
===================================================================
--- grass/trunk/raster/r.out.gdal/main.c	2008-03-03 08:19:16 UTC (rev 30432)
+++ grass/trunk/raster/r.out.gdal/main.c	2008-03-03 08:29:35 UTC (rev 30433)
@@ -608,14 +608,16 @@
 	   /* Special tricks for GeoTIFF color table support and such */
 	    if (dfCellMin >= 0 && dfCellMax < 256 ) {
 		datatype = GDT_Byte;
+		nodataval = (double)(unsigned char)0xFFu;
 	    } else {
 		if (dfCellMin >= 0 && dfCellMax < 65536 ) {
-			datatype = GDT_UInt16;
+		    datatype = GDT_UInt16;
+		    nodataval = (double)(short)0x8000;
 		} else {
-			datatype = GDT_Int32; /* need to furthermore fine tune this? */
+		    datatype = GDT_Int32; /* need to furthermore fine tune this? */
+		    nodataval = (double)(int)0x80000000;
 		}
 	    }
-	    nodataval = (double)(int)0x80000000;
 	}
     }
 



More information about the grass-commit mailing list