CPLErr VRTRasterBand::CopyCommonInfoFrom( GDALRasterBand * poSrcBand ) { SetMetadata( poSrcBand->GetMetadata() ); const char* pszNBits = poSrcBand->GetMetadataItem("NBITS", "IMAGE_STRUCTURE"); SetMetadataItem( "NBITS", pszNBits, "IMAGE_STRUCTURE" ); const char* pszPixelType = poSrcBand->GetMetadataItem("PIXELTYPE", "IMAGE_STRUCTURE"); SetMetadataItem( "PIXELTYPE", pszPixelType, "IMAGE_STRUCTURE" ); SetColorTable( poSrcBand->GetColorTable() ); SetColorInterpretation(poSrcBand->GetColorInterpretation()); if( strlen(poSrcBand->GetDescription()) > 0 ) SetDescription( poSrcBand->GetDescription() ); int bSuccess; double dfNoData; dfNoData = poSrcBand->GetNoDataValue( &bSuccess ); if( bSuccess ) SetNoDataValue( dfNoData ); SetOffset( poSrcBand->GetOffset() ); SetScale( poSrcBand->GetScale() ); SetCategoryNames( poSrcBand->GetCategoryNames() ); if( !EQUAL(poSrcBand->GetUnitType(),"") ) SetUnitType( poSrcBand->GetUnitType() ); return CE_None; }
CPLErr VRTRasterBand::CopyCommonInfoFrom( GDALRasterBand * poSrcBand ) { int bSuccess; double dfNoData; SetMetadata( poSrcBand->GetMetadata() ); SetColorTable( poSrcBand->GetColorTable() ); SetColorInterpretation(poSrcBand->GetColorInterpretation()); if( strlen(poSrcBand->GetDescription()) > 0 ) SetDescription( poSrcBand->GetDescription() ); dfNoData = poSrcBand->GetNoDataValue( &bSuccess ); if( bSuccess ) SetNoDataValue( dfNoData ); SetOffset( poSrcBand->GetOffset() ); SetScale( poSrcBand->GetScale() ); SetCategoryNames( poSrcBand->GetCategoryNames() ); if( !EQUAL(poSrcBand->GetUnitType(),"") ) SetUnitType( poSrcBand->GetUnitType() ); return CE_None; }