Skip to content

Commit

Permalink
VRT: honour relativeToVRT when using AddBand() to add a VRTRawRasterB…
Browse files Browse the repository at this point in the history
…and (patch by Antonio Valentino, OSGeo/gdal#67)

git-svn-id: https://svn.osgeo.org/gdal/trunk/gdal@29691 f0d54148-0727-0410-94bb-9a71ac55c965
  • Loading branch information
rouault committed Aug 20, 2015
1 parent aeb011b commit 5ac60ad
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions frmts/vrt/vrtdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,10 +921,18 @@ CPLErr VRTDataset::AddBand( GDALDataType eType, char **papszOptions )
VRTRawRasterBand *poBand =
new VRTRawRasterBand( this, GetRasterCount() + 1, eType );

eErr =
poBand->SetRawLink( pszFilename, NULL, bRelativeToVRT,
nImageOffset, nPixelOffset, nLineOffset,
char* pszVRTPath = CPLStrdup(CPLGetPath(GetDescription()));
if EQUAL(pszVRTPath, "")
{
CPLFree(pszVRTPath);
pszVRTPath = NULL;
}

eErr =
poBand->SetRawLink( pszFilename, pszVRTPath, bRelativeToVRT,
nImageOffset, nPixelOffset, nLineOffset,
pszByteOrder );
CPLFree(pszVRTPath);
if( eErr != CE_None )
{
delete poBand;
Expand Down

0 comments on commit 5ac60ad

Please sign in to comment.