[Gdal-dev] VRTCreateCopy() with no filename

Gregory, Matthew matt.gregory at oregonstate.edu
Thu Feb 22 15:50:32 EST 2007


I'm trying to follow a code snippet at
http://www.gdal.org/gdal_vrttut.html, namely:

---------

GDALDriver *poDriver = (GDALDriver *) GDALGetDriverByName( "VRT" );
GDALDataset *poSrcDS, *poVRTDS;

poSrcDS = (GDALDataset *) GDALOpenShared( "utm.tif", GA_ReadOnly );
poVRTDS = poDriver->CreateCopy( "", poSrcDS, FALSE, NULL, NULL, NULL );

GDALDriver *poTIFFDriver = (GDALDriver *) GDALGetDriverByName( "GTiff"
);
GDALDataset *poTiffDS;

poTiffDS = 
  poTIFFDriver->CreateCopy( "wrk.tif", poVRTDS, FALSE, NULL, NULL, NULL
);

---------

When I try to create the VRT copy with a filename, I have no problems.
But when I don't provide a filename (as in the sample), my computer
hangs.  

Here is the abbreviated call stack of the hanging location:

- VSIWin32Handle::Read
- VSIFReadL
- GDALFindAssociatedAuxFile
- GDALDefaultOverviews::Initialize
- VRTDataset::Create
- VRTCreateCopy

In gdal_misc.cpp at line 2412, it's returning a valid file pointer (fp)
which doesn't seem right.  Can anyone straighten me out?  Obviously, the
easy workaround is to create the temporary VRT and delete it later, but
I wanted to make sure I wasn't missing something.

thanks, matt

Matt Gregory
Faculty Research Assistant
Department of Forest Science
Oregon State University
Phone : (541) 758-7778
Email : matt.gregory at oregonstate.edu




More information about the Gdal-dev mailing list