[Gdal-dev] OGR Python examples

Tyler Mitchell TMitchell at lignum.com
Fri Oct 3 16:34:44 EDT 2003




I'm starting into OGR with python and am having fun reading ogr.py and
trying out my own little examples.
I've got most of what I'd call the basics down pat - opening data source,
reading a layer, feature and geometries.

Now I'm ready to write geometries and am missing something.  I've got a two
pairs of coordinates representing a rectangle and I want to create a
polygon out of it and save it to a file.  When I READ geometries I can
figure out that you open a data source->layer->feature->geometry.  But I
can't figure out what objects I need to create first to write to.  I've got
a data source and layer created, but what next?

Can anyone give me a small example?

I'm trying to stick as close to ogr.py as possible without mixing up too
much with other pymods, but I will consider them.

I'll post my little tutorial afterwards.




More information about the Gdal-dev mailing list