[gdal-dev] Loading from a stream/memory rather than a file

Frank Warmerdam warmerdam at pobox.com
Fri Mar 7 12:21:30 EST 2008


Christiaan Janssen wrote:
> Does anyone know if it is possible to create/open an image with GDAL using a
> stream or chunk of memory instead of a file? This would be useful in writing
> a caching mechanism but also to do in memory and other non file based
> processing.

Cristiaan,

Some driver utilize the VSI*L "virtual io" layer for file access, and then
you can either right custom file handlers, or more likely use the existing
in-memory VSI*L implementation.

This is likely the best explanation of the mechanism:
   http://www.gdal.org/cpl__vsi_8h.html#66e2e6f093fd42f8a941b962d4c8a19e

gdal/frmts/wcs/httpdriver.cpp is a simple example of it's use for reading
from memory.

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