[Gdal-dev] The whole dataset in memory?

Frank Warmerdam warmerdam at pobox.com
Mon Jan 5 12:18:50 EST 2004


Petteri Packalen wrote:
> Hi,
> 
> Is there any way in GDAL to load the whole dataset in memory? VRT
> Dataset can be created "in memory", but is it possible to load actual
> pixel data to memory as well. I would need as fast access to band data as
> possible (memory consumption is not a problem).

Petteri,

There is an all-in-memory driver (the MEM driver).  If you were to do a
CreateCopy() to that format you would have the data all-in-memory for sure.
However, normally it is sufficient to set the cache size up to be large enough
to hold the entire dataset and then do a pre-read pass to pull the data into
the cache.   The cache size can be set with GDALSetCacheMax(), the argument
being an integer cache size in bytes.

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