CreateCopy vs Create

Frank Warmerdam warmerdam at p...
Thu Nov 21 16:56:25 EST 2002


gwalter at a... wrote:
> Hi Frank,
> 
> What is the distinction between CreateCopy and Create in gdal?

Gillian,

The CreateCopy() method takes a complete dataset as the input, and
tries to create a duplicate of all the data in the target drivers
format, taking into account the passed in creation options.

The Create() method creates a new blank database which may be written
to randomly.

The distinction exists because many formats (well it's more an issue
of the libraries) require alot of information in advance before they
can start creating the file, including stuff like coordinate system and
metadata. Also, many formats can only be practically written with
certain output strategies. For instance, a pixel interleaved output
formats should be have the data streamed to it with all bands at ones.

It is therefore much easier to implement a CreateCopy() method for these
formats than it is also allow truely random update for writing them.

>From the application point of view, it is often harder to use the formats
with only a CreateCopy() method because a whole "image" of the desired
output file must be created in advance. The virtual format is often useful
for doing this without actually duplicating the underlying image data.

I hope this helps.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at p...
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