Skip to content

Commit

Permalink
ENH: Report projectionRef, geoTransform and GCPs for derived subdatasets
Browse files Browse the repository at this point in the history
  • Loading branch information
jmichel-otb committed Jul 6, 2016
1 parent 665d879 commit d384b9d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions gdal/frmts/cderived/cderiveddataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,26 @@ GDALDataset * ComplexDerivedDataset::Open(GDALOpenInfo * poOpenInfo)

// Transfer metadata
poDS->SetMetadata(poTmpDS->GetMetadata());

// Transfer projection
poDS->SetProjection(poTmpDS->GetProjectionRef());

for(int nBand = 1; nBand <= nbBands; ++nBand)
// Transfer geotransform
double padfTransform[6];
bool transformOk = poTmpDS->GetGeoTransform(padfTransform);
if(transformOk)
{
poDS->SetGeoTransform(padfTransform);
}

// Transfer GCPs
const char * gcpProjection = poTmpDS->GetGCPProjection();
int nbGcps = poTmpDS->GetGCPCount();
poDS->SetGCPs(nbGcps,poTmpDS->GetGCPs(),gcpProjection);


// Map bands
for(int nBand = 1; nBand <= nbBands; ++nBand)
{
VRTDerivedRasterBand * poBand;

GDALDataType type = GDT_Float64;
Expand Down

0 comments on commit d384b9d

Please sign in to comment.