[FWTools] a vote for python2.5

Chris Garrard chrisg at gis.usu.edu
Thu Oct 16 13:21:34 EDT 2008


I've set this up but haven't used it much.  I have a friend who used my
directions and uses it a lot, so it must work.  See
http://trac.osgeo.org/gdal/wiki/GdalOgrInPython to get started.  I've pasted
in the directions I put together for some friends a while ago.

1. Download the latest version of GDAL for Windows from
http://download.osgeo.org/gdal/win32/. I grabbed gdalwin32exe150.zip in the
1.5 folder.

2. Unzip the GDAL archive into a permanent location. I unzipped it right to
the C:\ drive, so I ended up with a folder called C:\gdalwin32-1.5.

3. Add your new GDAL bin directory to your system Path environment variable.
I added C:\gdalwin32-1.5\bin\.

4. Create a new system environment variable called GDAL_DATA and set the
value to the path of your new GDAL data directory. Mine was
C:\gdalwin32-1.5\data\.

5. Download the appropriate version of NumPy from
http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103.
Make sure you get the one for your version of Python. For me, this was
numpy-1.1.1-win32-superpack-python2.5.exe.

6. Install NumPy by running the file downloaded in the previous step.

7. Download the appropriate version of the GDAL Python Bindings from
http://pypi.python.org/pypi/GDAL/. The downloads are way down at the bottom
of the page. Make sure you get the one for your version of Python. For me,
this was GDAL-1.5.2.win32-py2.5.exe.

8. Install the GDAL Python Bindings by running the file downloaded in the
previous step.

9. Download PROJ.4 from http://download.osgeo.org/proj/. Unless you want to
compile it yourself, get the precompiled version for Windows. Unfortunately,
I didn't see one for the latest version and so I grabbed
proj446_win32_bin.zip.

10. Unzip the PROJ.4 archive into a permanent location. I unzipped it right
to the C:\ drive, so I ended up with a folder called C:\proj.

11. Add your new PROJ.4 bin directory to your system Path environment
variable. I added C:\proj\bin\.

12. Create a new system environment variable called PROJ_LIB and set the
value to the path of your new PROJ.4 nad directory. Mine was C:\proj\nad\.

13. Copy proj.dll from your PROJ.4 bin directory into your GDAL bin
directory. So I copied C:\proj\bin\proj.dll to
C:\gdalwin32-1.5\bin\proj.dll. I'm actually not sure why adding C:\proj\bin\
to my system Path environment variable didn't fix this problem, but I had to
actually copy the DLL in order to use OSR (part of GDAL). In theory, I
suppose you could register the DLL or copy it to your windows\system32
directory, but I bet that could break other things that use PROJ.4.

14. One last PROJ.4 related thing that I'm not sure why I have to do. It
couldn't seem to use the datum shift files, but it works if you copy the
correction files that are installed with FWTools into your PROJ.4 nad
directory. So get the latest Windows version of FWTools from
http://fwtools.maptools.org/ and install it. Then copy the contents of the
FWTools proj_lib directory into the PROJ.4 nad directory. I didn't want to
just throw away what was in the nad directory, so I moved the contents of
C:\proj\nad into C:\proj\nad\original. Then I copied the contents of
C:\Program Files\FWTools2.2.6\proj_lib into C:\proj\nad.

15. Might have to reboot.

16. In your scripts, import the modules using "from osgeo import gdal"
instead of "import gdal".

On Wed, Oct 15, 2008 at 9:42 PM, Bryan Keith <bryan at ideotrope.org> wrote:

> Frank's made it clear on this list a number of times before why he's not
> doing this.  Can the osgeo4w binaries be used with python 2.5?
>
> I assume you're on windows.  I'm using Python 2.5 with gdal on linux but
> am still using fwtools on windows.  Increasingly though I'm finding I need
> a newer version of Python like you and haven't got around to trying the
> osgeo4w binaries yet.
>
> Bryan
>
> > No, this doesn't work. Python 2.5 was built with MSVC 2005 but FWTools
> > supplies dll's built with MSVC 2003
> >
> > Mathew
> >
> >
> > Roger André wrote:
> >> Not sure if this will work, but can you add FWTools' pymod directory
> >> to your PYTHONPATH?
> >>
> >> Try:
> >>
> >> import sys
> >> sys.path.append('/usr/local/FWTools-2.0.6/pymod/')
> >>
> >> Then see if you can import the modules.
> >> --
> >>
> >>
> >>
> >> On Wed, Oct 15, 2008 at 4:12 PM, Mathew Yeates <myeates at jpl.nasa.gov
> >> <mailto:myeates at jpl.nasa.gov>> wrote:
> >>
> >>     Hi
> >>     I'm stuck using Python2.5 which means I can't use the gdal python
> >>     wrappers. If there is *any* way you can do this I'd appreciate it
> >>     MUCH.
> >>
> >>     Thanks
> >>     Mathew
> >>
> >>     _______________________________________________
> >>     FWTools mailing list
> >>     FWTools at lists.maptools.org <mailto:FWTools at lists.maptools.org>
> >>     http://lists.maptools.org/mailman/listinfo/fwtools
> >>     http://fwtools.maptools.org/
> >>
> >>
> >
> >
> > _______________________________________________
> > FWTools mailing list
> > FWTools at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/fwtools
> > http://fwtools.maptools.org/
> >
>
>
> _______________________________________________
> FWTools mailing list
> FWTools at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/fwtools
> http://fwtools.maptools.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20081016/3fb3c0f7/attachment.html


More information about the FWTools mailing list