Changeset 13479

Show
Ignore:
Timestamp:
01/07/08 08:49:17 (4 months ago)
Author:
dron
Message:

Fixed geotransormation matrix calculation as per bug #2132.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/frmts/gsg/gs7bgdataset.cpp

    r12155 r13479  
    516516        return CE_None; 
    517517 
    518     padfGeoTransform[0] = poGRB->dfMinX; 
    519     padfGeoTransform[1] = ( (poGRB->dfMaxX - poGRB->dfMinX)/ 
    520         (nRasterXSize - 1) ); 
     518    /* calculate pixel size first */ 
     519    padfGeoTransform[1] = (poGRB->dfMaxX - poGRB->dfMinX)/(nRasterXSize - 1); 
     520    padfGeoTransform[5] = (poGRB->dfMinY - poGRB->dfMaxY)/(nRasterYSize - 1); 
     521 
     522    /* then calculate image origin */ 
     523    padfGeoTransform[0] = poGRB->dfMinX - padfGeoTransform[1] / 2; 
     524    padfGeoTransform[3] = poGRB->dfMaxY - padfGeoTransform[5] / 2; 
     525 
     526    /* tilt/rotation does not supported by the GS grids */ 
     527    padfGeoTransform[4] = 0.0; 
    521528    padfGeoTransform[2] = 0.0; 
    522     padfGeoTransform[3] = poGRB->dfMinY; 
    523     padfGeoTransform[4] = 0.0; 
    524     padfGeoTransform[5] = ( (poGRB->dfMaxY - poGRB->dfMinY)/ 
    525         (nRasterYSize - 1) ); 
    526529 
    527530    return CE_None;