[GRASS-SVN] r56567 - grass/trunk/raster/r.in.gdal

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 2 14:37:47 PDT 2013


Author: mmetz
Date: 2013-06-02 14:37:47 -0700 (Sun, 02 Jun 2013)
New Revision: 56567

Modified:
   grass/trunk/raster/r.in.gdal/main.c
Log:
r.in.gdal: fix l1bdriver, TODO: figure out the need to flip GCP line

Modified: grass/trunk/raster/r.in.gdal/main.c
===================================================================
--- grass/trunk/raster/r.in.gdal/main.c	2013-06-02 21:33:53 UTC (rev 56566)
+++ grass/trunk/raster/r.in.gdal/main.c	2013-06-02 21:37:47 UTC (rev 56567)
@@ -604,6 +604,7 @@
 
 	    for (iGCP = 0; iGCP < sPoints.count; iGCP++) {
 		sPoints.e1[iGCP] = pasGCPs[iGCP].dfGCPPixel;
+		/* why cellhd.rows - line ? */
 		sPoints.n1[iGCP] = cellhd.rows - pasGCPs[iGCP].dfGCPLine;
 
 		sPoints.e2[iGCP] = pasGCPs[iGCP].dfGCPX;	/* target */
@@ -751,7 +752,7 @@
     /*      Select a cell type for the new cell.                            */
     /* -------------------------------------------------------------------- */
     eRawGDT = GDALGetRasterDataType(hBand);
-    
+
     switch (eRawGDT) {
     case GDT_Float32:
 	data_type = FCELL_TYPE;
@@ -905,7 +906,9 @@
     }				/* end of not AVHRR */
     else {
 	/* AVHRR - read from south to north to match GCPs */
-	for (row = nrows; row > 0; row--) {
+	/* AVHRR - read from north to south to match GCPs */
+	/* because lines are fliped by default (why ?) */
+	for (row = 1; row <= nrows; row++) {
 	    GDALRasterIO(hBand, GF_Read, 0, row - 1, ncols, 1,
 			 cell, ncols, 1, eGDT, 0, 0);
 
@@ -968,7 +971,7 @@
 	Rast_short_history((char *)output, "raster", &history);
 	Rast_command_history(&history);
 	Rast_write_history((char *)output, &history);
-	
+
 	G_free(cell);
     }
 



More information about the grass-commit mailing list