| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Using GDAL with Python

This version was saved 14 years, 5 months ago View current version     Page history
Saved by J A Glennon
on October 22, 2009 at 10:45:52 pm
 
Installation Instruction for Windows
We need to test and modify this as necessary (22 October 20009)

1. Go to http://www.python.org/download/ and install Python 2.6. Python 2.6.x Windows Installer is probably the best one to use. 
Download, double click the package, and follow the onscreen installation instructions.


2. Get GDAL. For Windows, a good place to get it is: http://download.osgeo.org/gdal/win32/1.6/
It'll have a name like: gdalwin32exe160.zip. With that file, when you unzip it, it should be a folder called gdal32-1.6 (or similar) 
with two folders in it: bin and data. Place the gdal32-1.6 whereever you prefer, but note where it is. You'll need the path name later. 
I'll place mine at: c:\gdal32-1.6


3. You noq need to modify your Windows system path and an environment variable. Here's what you do: a) In Windows, find "My Computer", 
right click your mouse to reveal a context menu, and select "Properties". This will yield a System Properties window. 
Select the "Advanced" tab, and click the button "Environment Variables". This opens an Environment Variables window. 
In the user variables area, click on "New" button. This opens a dialog box. Fill in the boxes with the following information:

Name: GDAL_DATA
Path: C:\gdalwin32-1.6\data

Click OK.

Next, in the System Variables section, scroll down until the variable "Path" is highlighted. Click the "Edit" button; it will open a 
dialog box called Edit System Variable. Leave the variable name "Path" unchanged. The Variable value area is a small box usually 
overflowing with variables. Make sure not to delete any of those variable names. If you accidentally do, click cancel. 
Otherwise, after all the existing variables in the small dialog area, add a semicolon, then the path to your gdal bin fold
rer(something like this: ;C:\gdalwin32-1.6\bin). Click the OK button, and it will close that Edit System Variable window. 
Click the OK button at the bottom of the Environment Variables dialog window. Click the OK button at the bottom of the System 
Properties' Advanced tab.


4. Now, you'll need the bindings to make GDAL and Python work together. Head over to http://pypi.python.org/pypi/GDAL/, 
look near the bottom of that website, and grab the MS Windows installer for Python 2.6. It will be called something 
like: GDAL-1.6.1.win32-py2.6.exe. Download, double click on the package, and follow the onscreen installation instructions.

5. you can test to see if it worked by going into a Python shell and typing: from osgeo import ogr. If it doesn't work, 
you might try restarting your computer. 

Comments (0)

You don't have permission to comment on this page.