[Gdal-dev] [Patch] Problem with gdal_translate with the parameter -a_ullr 0 0 x x

Jean-Claude Repetto jean-claude.repetto at worldonline.fr
Wed Oct 24 06:16:48 EDT 2007


Jean-Claude Repetto wrote :
> 
> The ECW file is correct. I have checked it by reading it directly with
> the ECW library.
> The bug occurs when GDAL reads the file. I have looked at the source
> code (version 1.4.2), and it seems the bug is in the file ecwdataset.cpp .

This is a patch that I propose :

--- frmts/ecw/ecwdataset.cpp.orig       2007-10-24 11:35:44.000000000 +0200
+++ frmts/ecw/ecwdataset.cpp    2007-10-24 11:41:59.000000000 +0200
@@ -1539,9 +1539,9 @@

      if( psFileInfo->fOriginX != 0.0
          || psFileInfo->fOriginY != 0.0
-        && (psFileInfo->fCellIncrementX != 0.0 &&
+        || (psFileInfo->fCellIncrementX != 0.0 &&
              psFileInfo->fCellIncrementX != 1.0)
-        && (psFileInfo->fCellIncrementY != 0.0 &&
+        || (psFileInfo->fCellIncrementY != 0.0 &&
              psFileInfo->fCellIncrementY != 1.0) )
      {
          bGeoTransformValid = TRUE;


With this patch applied to GDAL 1.4.2, both gdalinfo and qgis give 
correct results.

Regards,
Jean-Claude



More information about the Gdal-dev mailing list