Saturday 22 March 2014

Configuring python for GIS operations

There are good open source APIs and libraries to work on Geospatial Information System(GIS) using Python. In this post I'll go through the installation of Geospatial Data Abstraction Library and its python bindings. I'll also go through PROJ.4 and pyProj APi which is used to convert geodetic data from one datum/projection to other. I'll be configuring this environment on windows-64 bit PC. Here you go


  • Install 2.7 (don't install 3.x) python from https://www.python.org/downloads/
  • Now go to this link
  • Download and install appropriate "Generic installer for the GDAL core components" MSI for the version of windows you are using.
  • Also download and install "Installer for the GDAL python bindingsMSI for the version of python you have installed.
  • Add a GDAL_DATA environmental variable with value “C:\Program Files\GDAL\gdal-data”
  • Also add the “C:\Program Files\GDAL” to PATH environmental variable.
  • Now go to your python prompt and test whether the installed GDAL modules are working by using the following command
  >>>import osgeo
  >>>
  • If the command prompt appears without any message then you are successful in setting the GDAL API for python
  • Now we need to install PROJ.4
  • Download PROJ.4
  • Extract and copy "proj" folder to C:\
  • Add "C:\proj\bin" PATH environmental variable.
  • Also add PROJ_LIB enviromental variable with value "C:\proj\nad".
  • Add PROJ_DIR environmental variable with value "C:\proj"
  • Now download and install appropriate pyproj exe from here (if you get any error related to registry during installation, just export python registry keys from LOCAL_MACHINE and change the key names from LOCAL_MACHINE to CURRENT_USER and try the installation again)
  • After the installation check the PyProj module is installed correctly or not by using the following command.
  >>>import pyproj
  >>>
  • If the command prompt appears without any message then you are successful in installing PYPROJ API.
Now everything is set work on Geospatial data. Happy coding... :)

1 comments:

  1. Well organized, crisp and simple... Thanks for posting

    ReplyDelete