GDAL on Windows

From Wildsong
Jump to navigationJump to search

Download latest sources

http://download.osgeo.org/gdal/gdal173.zip

Unpack someplace convenient. D:/Brian/gdal-1.7.3/

I think you will need the current Windows version of Swig too.

http://sourceforge.net/projects/swig/files/swigwin/swigwin-2.0.1/swigwin-2.0.1.zip/download

I unpacked it into D:/Brian/swigwin-2.0.1/

Open in Visual Studio and build

I had to put the VS2010 disc in and install C++ so that I could open the vcxproj files. When I originally installed, I only loaded up C#.

Then I can simply doubleclick on makegdal10.sln

Change installation destination. By default it is C:\warmerda\bld I change it to C:\GDAL by editing GDAL_HOME in "Make Files\nmake.opt"

I set this: MSVC_VER=1600

I am currently using ArcGIS 9.3.1, which installed Python 2.5 for me, so I want to build modules for that. So I edit PYDIR in nmake.opt to set it to C:\Python25

I am building on a 64 bit machine but ArcGIS is only 32-bit. Not sure what to do, so for now I leave WIN64 alone. (Commented out)

I will need to edit this further to support other formats, MrSid for instance.

Finally, I set the thing in Release mode and say Build.

Build ArcObjects plugin

This lets me access ESRI format data objects like "file geodatabases".

Build Python modules

I need swig.exe for this. I need to set the environment appropriately, per Swig docs

PYTHON_INCLUDE : Set this to the directory that contains python.h
PYTHON_LIB : Set this to the python library including path for linking

Example using Python 2.5:

PYTHON_INCLUDE: C:\Python25\include
PYTHON_LIB: C:\Python25\libs\python25.lib