[gdal-dev] Accessing GDAL/OGR From Python: Simple Feature and Rasters

Sunburned Surveyor sunburned.surveyor at gmail.com
Thu Nov 26 12:02:57 EST 2009

Ragi Burhum and I decided it would be good if the California Chapter
of the OSGeo could get together to work on a simple open source GIS
project. (California is the home to the Silicon Valley, after all.)
After kicking around several ideas for projects, we decided to work on
a set of geoprocessing pipes implemented in Python. I am not an
experienced Python programmer, or very familiar with GDAL/OGR. But I'm
ready to learn Python, and Ragi has worked with GDAL/OGR in C++.

I'm trying to start work on my first pipe for our project. The input
of this pipe will be a set of simple features represented by point
geometries and an elevation grid/surface. The output of the pipe will
be a modified set of simple features. The point geometries of these
modified simple features will have an elevation based on the points
horizontal location "over" the elevation grid.

Here are my questions:

Is there a OGR programming construct to represent a simple feature? If
there is, can you tell me where to look for the Python files that
would represent these simple features? Is there any example Python
code that will show me how to obtain simple features from an ESRI

I also need to know if GDAL has programming constructs to work with
elevation grids. If it does, where do I look for those Python files?

I realize that GDAL/OGR are written in C++ and not Python. If there
isn't a place to easiliy locate the Python files then I will work with
Ragi to build the Python files from the C++ source using SWIG
(something I know absolutely nothing about).

I know everyone is busy. I don't want anyone to write my code for me,
but any suggestions on where I start looking in the source code so I
can learn how to do what I need with the library is appreciated.

I will make a commitment to make documentation/Python code for working
with GDAL/ODR that results from our project available to everyone that
is interested.

Thanks for the help. Please remember I am a Java programmer, which
means I will require extra patience. Ragi and I wanted to get some
working code before we announce our project to the OSGeo community, so
I appreciate your discretion while we get things started. We don't
want to be dismissed as another idea that is all talk and no
substance. :]


More information about the gdal-dev mailing list