Skip to content

Commit

Permalink
ENH: Expose derived subdatasets in SetBand()
Browse files Browse the repository at this point in the history
  • Loading branch information
jmichel-otb committed Jul 5, 2016
1 parent e277ccf commit 665d879
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gdal/gcore/gdaldataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,15 @@ void GDALDataset::SetBand( int nNewBand, GDALRasterBand * poBand )
"Cannot allocate band array");
return;
}

papoBands = papoNewBands;

// TODO: Filter on complex bands only
SetMetadataItem("DERIVED_SUBDATASET_1_NAME",CPLSPrintf("DERIVED_SUBDATASET:COMPLEX_AMPLITUDE:%s",GetDescription()),"DERIVED_SUBDATASETS");

CPLString osDesc(CPLSPrintf("Complex amplitude of bands from %s",GetDescription()));
SetMetadataItem("DERIVED_SUBDATASET_1_DESC",osDesc.c_str(),"DERIVED_SUBDATASETS");

for( int i = nBands; i < nNewBand; ++i )
papoBands[i] = NULL;

Expand Down

0 comments on commit 665d879

Please sign in to comment.