GDAL on Windows: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
Brian Wilson (talk | contribs)
Line 5: Line 5:
Unpack someplace convenient. D:/Brian/gdal-1.7.3/
Unpack someplace convenient. D:/Brian/gdal-1.7.3/


I think you will need the current Windows version of Swig too.
The docs say I don't need swig but the current Windows version of Swig is available here:


http://sourceforge.net/projects/swig/files/swigwin/swigwin-2.0.1/swigwin-2.0.1.zip/download
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/
I unpacked it into D:/Brian/swigwin-2.0.1/
'''I probably want to install Expat sources to get support for KML, GPX, and GeoRSS, but not just now.
'''


===Open in Visual Studio and build===
===Open in Visual Studio and build===

Revision as of 01:17, 4 December 2010

Download latest sources

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

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

The docs say I don't need swig but the current Windows version of Swig is available here:

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/

I probably want to install Expat sources to get support for KML, GPX, and GeoRSS, but not just now.

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

For Swig, I used this: SWIG = "D:\Brian\swigwin-2.0.1\swig.exe"

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. Man, it sure does produce a lot of messages. Not much chance I can read all that. Heh. These are the important lines to me:

1>------ Rebuild All started: Project: makegdal, Configuration: Release Win32 ------
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

I now check the output in C:\GDAL\bin, I set GDAL_DATA to C:\GDAL\data, add C:\GDAL\bin to PATH and try running a few of the commands in bin and things appear to work.

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