[Gdal-dev] In memory OGR layers?

Frank Warmerdam warmerdam at pobox.com
Thu Apr 19 21:28:58 EDT 2007


Simon Perkins wrote:
> Is there an OGR format that I can use to create a vector layer in 
> memory? Similar to the MEM driver for GDAL, but for vector layers?
> 
> In my application I have a need to create a vector layer and I don't 
> want it to be backed up with a file unless the user subsequently decides 
> to save it as one. However, I want my same vector layer rendering 
> machinery to be able to handle regular OGR layers as well, so it would 
> be convenient if I could create an internal memory layer and access it 
> via OGR.
> 
> Any suggestions?

Simon,

Absolutely. It is the "Memory" driver for OGR.  It basically just
holds an array of features behind the normal OGR API.  It is quite
"full featured" as var as update goes, and has been used by some
applications as the main container for vector layers they want to
render quickly, and also be able to edit in place.  The SilverEye
application from GeoTango did this quite successfully.  Of course
care should be taken with large numbers of features, since it is
rather memory hungry.  The in-memory representation is just OGRFeature's
and this isn't a particularly compact feature representation.

Hmm, I notice there isn't any driver page for this driver!  I suppose
I had better fix it.  I'll try and add one, and list it at:

   http://www.gdal.org/ogr/ogr_formats.html

sometime tonight.

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