[Gdal-dev] GDAL scripting with Python 2.5 (on windows)

Aleksey Naumov anaumov at gmail.com
Wed Oct 21 13:12:58 EDT 2009


Markus,

Thank you for your detailed help and reference to the previous discussion on
switching to the GDAL 1.6 environment (gdal16.bat). I mostly got OSGeo4W to
work for me, thanks to comment from Ivan, just have some issues with ECW and
MrSID support.

Thanks for the pointer to use "from osgeo import gdal" instead of "import
gdal". you are right, that was not my problem (the problem was, in fact,
missing gdal-python bindings package), but it is good to know, I fixed my
scripts to use the "osgeo" namespace.

I probably will not venture into setting the OSGeo4W python to be the
default on my system (have to careful with ESRI products and some other
things), but thank you for the pointers. I'll look at them for info.

Take care,

Aleksey


On Mon, Oct 19, 2009 at 11:01 PM, Markus Reinhold <
markus.reinhold at uni-jena.de> wrote:

>
> Hej,
>
>
> Aleksey Naumov-2 wrote:
> >
> > My problem is being able to do scripting with GDAL using Python 2.5 (this
> > version is important because of integration/compatibility with a number
> of
> > other packages, mainly IPython), and I need to be able to do it on
> > Windows.
> > I attempted a few approaches, but could not figure out how to get all the
> > pieces to work together:
> >
>
> first things first: It is definitely possible to use the GDAL Python 1.6
> bindings on Python 2.5 under Windows, cause
> http://www.box.net/shared/pp82vkdp8j that's what I'm running over here  as
> well. Now I can't give a detailed installation instruction as it was a
> piecewise work, but following is what I can recall:
> 1) I'm using the installer from OSGeo4W to setup my geospatial toolbox.
> Using the advanced installation process the packages I'm considering
> important are python, gdal (or gdal16), gdal-python (or gdal16-python),
> python-numpy and python-win32. The latter two I'm not sure how essential
> they really are, I have them installed in any way.
> 2) To use version 1.6 of GDAL it is necessary to a) install the
> corresponding packages (see above) and b) switch to the 1.6 environment
> using gdal16.bat under osgeo4w\bin\gdal16.bat. However this works for the
> OSGeo4W shell only and is not applied system-wide. See
> http://n2.nabble.com/Python-1-6-bindings-under-Windows-td3337254.html my
> conversation with the list on this matter  a few weeks ago. I've adjusted
> the %PYTHONPATH% to
> *C:\OSGeo4W\apps\gdal-16\pymod;C:\OSGeo4W\apps\Python25\Lib* on my system
> to
> use gdal16 system-wide.
> 3) A minor thing. When importing the bindings I use *from osgeo import
> gdal*
> instead of *import gdal*. However that does not seem to be your problem as
> the latter alternative should give you a deprecation warning but not refuse
> to work altogether.
> 4) The Python version of OSGeo4W is the default one on my system. It works
> fine, I only had a few problems when installing third-party extensions that
> need correct registry settings for the installation. Have a look a
> http://effbot.org/zone/python-register.htm this script  (and especially
> the
> last comment) on how to fix this problem.
> That's all what I can think of now. Maybe there's something you can look at
> to find a solution for your problems.
> Regards,
> Markus
>
>
> -----
> --
>
> ********************************************************
> Dipl.-Kartograph Markus Reinhold
>
> Chair of Geoinformatics, Geohydrology and Modeling
> Friedrich-Schiller-University Jena
> Löbdergraben 32
> D - 07743 Jena
> Germany
>
> Phone.: (+49)(0)3641 / 9 488 65
> E-Mail: markus.reinhold at uni-jena.de
> ********************************************************
> --
> View this message in context:
> http://n2.nabble.com/GDAL-scripting-with-Python-2-5-on-windows-tp3851288p3856494.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20091021/4683321c/attachment-0001.html


More information about the gdal-dev mailing list