[gdal-dev] Question about using Python API to GDAL/OGR in a "production" environment

Sean Gillies sgillies at frii.com
Fri Jan 18 13:16:30 EST 2008


Roger André wrote:
> I've been using the GDAL and OGR modules in Python scripts for a little
> while now to automate a variety of tasks at work.  It's worked very well,
> and I would now like to use it in conjunction with Apache and FastCGI to
> create some web services that read a variety of different data sources and
> serve up KML and custom data strings that feed web-based map API's.
> However, I've been strongly cautioned not to do this, as I'm told that GDAL
> isn't "thread safe", and that I would need to write some sort of "connection
> manager" to manage "things".  This intrigues me, and in no way dissuades me
> from trying my idea out, but I'm curious if some of you have used GDAL/OGR
> in a similar fashion in a "production" environment?  (Just exactly what
> constitutes a 'production', or 'Enterprise' system is also a topic of some
> interest to me.)  My use would strictly be "read-only", and using the Python
> API.
> 
> Any feedback or suggestions of things to keep in mind would be greatly
> appreciated.
> 
> Roger
> --

Roger,

You'll be fine in read-only mode. You may get advice that you should use
MapServer or GeoServer to do this, but ogr.py combined with KML
templates can do the job just as well. BTW, I'm using mod_wsgi for
Apache at http://zcologia.com/hammock/index.html and
http://zcologia.com/hammock/places.kml and it works fine. Much easier
than FastCGI.

Cheers,
Sean



More information about the gdal-dev mailing list