[Gdal-dev] GDALDatasetCopyWholeRaster() and RFC 14: Image Structure Metadata

Frank Warmerdam warmerdam at pobox.com
Tue Nov 6 23:15:00 EST 2007


Folks,

I have made some nontrivial changes to GDAL in svn trunk today.

I have added a new GDALDatasetCopyWholeRaster() function primarily intended
for use by CreateCopy() methods:

/**
  * Copy all dataset raster data.
  *
  * This function copies the complete raster contents of one dataset to
  * another similarly configured dataset.  The source and destination
  * dataset must have the same number of bands, and the same width
  * and height.  The bands do not have to have the same data type.
  *
  * This function is primarily intended to support implementation of
  * driver specific CreateCopy() functions.  It implements efficient copying,
  * in particular "chunking" the copy in substantial blocks and, if appropriate,
  * performing the transfer in a pixel interleaved fashion.
  *
  * Currently the only papszOptions value supported is "INTERLEAVE=PIXEL"
  * to force pixel interleaved operation.  More options may be supported in
  * the future.
  *
  * @param hSrcDS the source dataset
  * @param hDstDS the destination dataset
  * @param papszOptions transfer hints in "StringList" Name=Value format.
  * @param pfnProgress progress reporting function.
  * @param pProgressData callback data for progress function.
  *
  * @return CE_None on success, or CE_Failure on failure.
  */

CPLErr CPL_STDCALL GDALDatasetCopyWholeRaster(
     GDALDatasetH hSrcDS, GDALDatasetH hDstDS, char **papszOptions,
     GDALProgressFunc pfnProgress, void *pProgressData );

The key here is that it knows how to check for whether interleaved copies
are best.  It also copies in substantial chunks which can be quite a bit
faster for some formats (like jpeg2000 inputs).

This leads back to RFC 14 which included a consistent way of indicating
a datasets internal interleaving.  I've refreshed this RFC and I'd
like to bring it forward for discussion this week.  Later in the week
(barring big issues), I plan to motion for it's adoption.

   http://trac.osgeo.org/gdal/wiki/rfc14_imagestructure

A significant portion of the work is already done, but I'm willing
to change it if things aren't acceptable as defined.

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    | President OSGeo, http://osgeo.org




More information about the gdal-dev mailing list