[FWTools] a vote for python2.5

Wolfgang wollez at gmx.net
Thu Oct 16 13:41:16 EDT 2008


Chris Garrard schrieb:
> 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 
> <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".

you could also try python(x,y) http://www.pythonxy.com/ as it comes with 
many interesting packages.

Regards
Wolfgang



More information about the FWTools mailing list