Opened 16 years ago
Closed 16 years ago
#2132 closed defect (fixed)
Golden Software Surfer 7 Georeferencing is incorrect
Reported by: | ReedC | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | GDAL_Raster | Version: | svn-trunk |
Severity: | normal | Keywords: | |
Cc: | dron |
Description
Last year, a changeset was submitted which fixed the golden software 6 file formats (10814), but unfortunately it wasn't applied to the surfer 7 file format which has the exact same issue.
This can be fixed by replacing the GetGeoTransform method in frmts/gsg/gs7bgdataset.cpp with the following snippet:
/************************************************************************/ /* GetGeoTransform() */ /************************************************************************/ CPLErr GS7BGDataset::GetGeoTransform( double *padfGeoTransform ) { if( padfGeoTransform == NULL ) return CE_Failure; GS7BGRasterBand *poGRB = (GS7BGRasterBand *)GetRasterBand( 1 ); if( poGRB == NULL ) { padfGeoTransform[0] = 0; padfGeoTransform[1] = 1; padfGeoTransform[2] = 0; padfGeoTransform[3] = 0; padfGeoTransform[4] = 0; padfGeoTransform[5] = 1; return CE_Failure; } /* check if we have a PAM GeoTransform stored */ CPLPushErrorHandler( CPLQuietErrorHandler ); CPLErr eErr = GDALPamDataset::GetGeoTransform( padfGeoTransform ); CPLPopErrorHandler(); if( eErr == CE_None ) return CE_None; /* calculate pixel size first */ padfGeoTransform[1] = (poGRB->dfMaxX - poGRB->dfMinX)/(nRasterXSize - 1); padfGeoTransform[5] = (poGRB->dfMinY - poGRB->dfMaxY)/(nRasterYSize - 1); /* then calculate image origin */ padfGeoTransform[0] = poGRB->dfMinX - padfGeoTransform[1] / 2; padfGeoTransform[3] = poGRB->dfMaxY - padfGeoTransform[5] / 2; /* tilt/rotation does not supported by the GS grids */ padfGeoTransform[4] = 0.0; padfGeoTransform[2] = 0.0; return CE_None; }
Attachments (1)
Change History (2)
by , 16 years ago
Attachment: | geogeotransform.cpp added |
---|
comment:1 by , 16 years ago
Cc: | added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Code to fix issue