Opened 21 years ago

Last modified 8 years ago

#393 closed defect

ECW, GetGeoTransform returns posetive fCellIncrementY — at Version 2

Reported by: llo@… Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: minor Keywords: ECW
Cc: gaopeng, rprinceley, Mateusz Łoskot

Description (last modified by gaopeng)

Trying to display some sample ECW datasets, using Mapserver/GDAL failed, but 
the ECW files worked with some mapInfo product using a .tab file with 
georefrence info.

The problem was that the images was ignored due to a posetive fCellIncrementY 
returned from GetGeoTransform.

The following fix, was done on the GDAL CVS version from 16 June 03.

I added the following code to ECWDataset::GetGeoTransform, line 466
    if (padfTransform[5] > 0.0)
      padfTransform[5] = -padfTransform[5];
And
    if (adfGeoTransform[5] > 0.0)
      adfGeoTransform[5] = -adfGeoTransform[5];
To GDALDataset *ECWCreateCopy, before line 671.

The the problem was solved. I dont know if this is a problem in the ECW driver, 
or if the problem is caused by a malformed ECW georeferencing info.

Change History (2)

comment:1 by warmerdam, 21 years ago

Lars,

I have reviewed a bunch of georeferenced ecw files I have, and they all have
negative fCellIncrementY values.  I am therefore hesitant to apply your change
for fear of messing up the expected behaviour in cases of ungeoreferenced 
images.  

So, for now I will do nothing, but if I see it coming up alot I will apply
the suggested patch. 

Thanks,

comment:2 by gaopeng, 13 years ago

Description: modified (diff)
Resolution: invalid
Status: closedreopened

I reopen this ticket as we have many cases where fCellIncrementY has positive value. We have cases reported by the following offices in different regions:

GISTEC, SHARJAH ESRI KOREA INC, SEOUL ESRI CANADA LIMITED, TORONTO ESRI AUSTRALIA PTY LTD, BRISBANE LOCUS LTD, DEVONSHIRE (Bermuda)

I'd suggest the following fix, which should be safer:

        adfGeoTransform[5] = -fabs(psFileInfo->fCellIncrementY);
Note: See TracTickets for help on using tickets.