[Gdal-dev] Bug fixed in ENVI driver

Sebastien Grignard sebastien.grignard at archivideo.com
Wed Aug 18 10:26:21 EDT 2004


Hello,

I've fixed a bug in ENVI driver that happened when creating a band with 
a start offset greater that 2 Gbytes.
I've also added support for geotransform parameters on creation even if 
there are no projection information.
The included file is a diff against the current cvs.

-- 
Sebastien Grignard
R&D Developer
Archivideo
40, rue des Veyettes - 35000 Rennes FRANCE
Phone: +033 2 99 86 30 20

-------------- next part --------------
Index: envidataset.cpp
===================================================================
RCS file: /cvsroot/osrs/gdal/frmts/raw/envidataset.cpp,v
retrieving revision 1.18
diff -u -r1.18 envidataset.cpp
--- envidataset.cpp	28 Jul 2004 14:33:27 -0000	1.18
+++ envidataset.cpp	18 Aug 2004 14:20:54 -0000
@@ -389,7 +389,15 @@
 		adfGeoTransform[0], adfGeoTransform[3], adfGeoTransform[1],
 		dfPixelY, iUTMZone, pszHemisphere);
 	}
+    } else {
+      // Suppose we are in North hemisphere.
+      double dfPixelY = -adfGeoTransform[5];
+      const char* pszHemisphere = "North";
+      VSIFPrintf( fp, "map info = {Unknown, 1, 1, %f, %f, %f, %f, %d, %s}\n",
+                  adfGeoTransform[0], adfGeoTransform[3], adfGeoTransform[1],
+                  dfPixelY, 0, pszHemisphere);
     }
+    
 
     VSIFPrintf( fp, "band names = {\n" );
     for ( int i = 1; i <= nBands; i++ )
@@ -920,13 +928,13 @@
     {
         nLineOffset = nDataSize * nSamples;
         nPixelOffset = nDataSize;
-        nBandOffset = nLineOffset * nLines;
+        nBandOffset = (vsi_l_offset)nLineOffset * nLines;
     }
     else if( EQUALN(pszInterleave, "bil", 3) )
     {
         nLineOffset = nDataSize * nSamples * nBands;
         nPixelOffset = nDataSize;
-        nBandOffset = nDataSize * nSamples;
+        nBandOffset = (vsi_l_offset)nDataSize * nSamples;
     }
     else if( EQUALN(pszInterleave, "bip", 3) )
     {


More information about the Gdal-dev mailing list