[gdal-dev] Re: gdal-dev Digest, Vol 45, Issue 7

Mateusz Loskot mateusz at loskot.net
Tue Feb 5 10:29:59 EST 2008


Romain Garrigues wrote:
> In fact, my question is : if you want to read an existing shapefile, 
> store it in memory, and then write it back on disk (from memory), how do 
> you proceed ?

Romain,

I have to confess I'm still having problems with getting the point.
AFAIU, you know how to read an existing shapefile.
You read it into an instance of the OGRFeature type.
This object is actually a copy of data from shapefile
and is stored in memory.
Now, AFAIU, you want to modify this object (modify a feature attributes, 
geometry) and write back to shapefile, on the same place, if I am correct.

You can achieve the latter using OGRFeature::SetFeature [1] method.

Does it answer your question?

[1]
http://gdal.org/ogr/classOGRLayer.html#681139bfd585b74d7218e51a32144283


Best regards
-- 
Mateusz Loskot
http://mateusz.loskot.net


More information about the gdal-dev mailing list