7

The GDAL library homepage implies that people who arrive there already know what they are doing. I work with ArcGIS, and am unfamiliar with intricate setups with library dependencies as GDAL suggests. Is there an easy "package" i can download? I have found maptools.org, and i guess the libraries that has is accessible by any programming language of choice? I also found QGIS which apparently uses GDAL.

I am looking into GDAL because it has functionality that ArcGIS does not. My language of choice is python. What is my best (and easieist) route to take here??

thanks!

em kay
  • 71
  • 1
  • 2

3 Answers3

4

The easiest option is probably to use the OSGeo4W (for Windows) installer. With this you can select GDAL from a large list of OpenSource GIS tools. Under "libs" select the version of GDAL you want. To add Python support select gdal**-python making sure the versions match. You can uncheck anything else (except I think you need Python-numpy which is selected by default):

http://trac.osgeo.org/osgeo4w/

Then check out some of the sample Python / GDAL scripts at:

http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/

More GDAL Python details here:

http://pypi.python.org/pypi/GDAL/

Other Options

Take a look at http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries

You can run the set up package in the zip here (there doesn't seem to be a 1.7 version out yet):

http://download.osgeo.org/gdal/win32/1.6/gdalwin32exe160.zip

A smaller collection of tools can be found here (FW is for Frank Warmerdam the creator/maintainer of GDAL):

http://trac.osgeo.org/gdal/wiki/FWTools

geographika
  • 6,458
  • 4
  • 38
  • 56
  • OSGeo4w is the preferred route on Windows. FWTools is de-emphasized and is mainly supported out of consideration for those who have become accustomed to it and are not ready to change. It is possible to [http://yukongis.ca/How_To/Shared_ArcGIS_and_Osgeo4W_python_install share a single python install between arcgis and o4w], but to begin with it is simpler to keep the two in parallel and ignorant of each other. – matt wilkie May 13 '10 at 04:28
4

If you want to add a ready-made GIS to your python/GDAL code, Quantum GIS (Qgis) has an embedded python interpreter and a full python API. You can write plugins for Qgis in python, and use GDAL functions for raster data. Qgis is in the osgeo4w system.

Spacedman
  • 92,590
  • 12
  • 140
  • 224
2

Download:

Installation:

  1. Run the Python installer to install python
  2. Unzip the GDAL archive and place it in c:\gdal-1.6
  3. Add a GDAL_DATA user variable with containing the full path to the data folder "C:\gdal32-1.6\data" (Control Panel > System Properties > Advanced tab > Environment Variables)
  4. Append "C:\gdal32-1.6\bin" to your system path
  5. Unzip the PROJ4 archive and place it in c:\PROJ
  6. Append "C:\PROJ\bin" to your system path
  7. Unzip the GDAL Python bindings and copy the osgeo folder to "C:\Python26\Lib\site-packages"
  8. You might need to append "C:\Python26\Lib\site-packages" to your system path.

Testing: Open IDLE and type

from osgeo import gdal

I have found these instructions useful, but not entirely applicable or up to date: http://www.gis.usu.edu/~chrisg/python/2009/docs/gdal_win.pdf. Note that a newer version of GDAL is available (1.7.3), but needs to be compiled from source and that no windows executable exists yet. Version 1.6 contains a few very serious bugs.

Benjamin
  • 11,560
  • 13
  • 70
  • 119