[gdal-dev] Slow createCopy()

Frank Warmerdam warmerdam at pobox.com
Mon Nov 24 17:10:13 EST 2008


Tom V. wrote:
> Hi,
> 
> I'm using gdal 1.4.2 to write out NITF and GeoTiff images.  The
> createCopy() call takes only a few minutes to write out a small file, 300
> or so mb's, but takes anywhere from 1.5-3 hours to write out a single band
> 1.2 gb NITF or GeoTiff.  I have not tried a larger multi-spectral image.
> 
> The call looks like:
> GDALDatasetH hOutDS = GDALCreateCopy( hDriver, pszDest, (GDALDatasetH)
> poVDS, false, papszCreateOptions, pfnProgress, NULL );
> 
> with papszCreateOptions and pfnProgress being NULL in this case, hDriver
> being the appropriate driver and, and poVDS being a vrtdataset.
> 
> If anyone has any idea why the larger files would take so long, that would
> be awesome!

Tom,

You didn't indicate much about the configuration of the input and output
files.  But I suspect cache thrashing.  If that is the case, upping the
memory cache size will help (dramatically).

Try setting the GDAL_CACHEMAX environment variable to 200 before running,
or call GDALSetCacheMax( 200 ).   This would use up to 200MB for the
intermediate block cache.  This is particular important when going from
scanline oriented formats to tile oriented formats or the other way around.

If this isn't already in the FAQ, it really needs to be!

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list