[gdal-dev] ogr2ogr in python

Paolo Corti pcorti at gmail.com
Wed Feb 8 05:46:11 EST 2012


On Wed, Feb 8, 2012 at 11:38 AM, Alessandro Candini <candini at meeo.it> wrote:
> You are right: I have put ogr2ogr.py file inside /usr/bin and...
>
> user at office ~ $ ogr2ogr.py
> ERROR: Python bindings of GDAL 1.8.0 or later required
>
> The problem is that I cannot update my GDAL version at the moment, it will
> mess up all my dependencies and so on...
>
> Is there an alternative?
>

Alessandro,
maybe I am misunderstanding here, but if you need to run the ogr2ogr
command, why don't you run the version included in your package as an
external command from Python?
You may use the subprocess library for doing this, like:

>>> from subprocess import call
>>> call(['ogr2ogr'])

best regards
P

-- 
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti


More information about the gdal-dev mailing list