GdalIs a database that operates on various grid geographic data formats. It supports reading, writing, conversion, and processing various grid data formats. Of course, in addition to operating the Raster Data, this library also includes another famous library for operating vector data, OGR, and many well-knownOpen SourceGISSoftware such as grass and qgis processes underlying data based on gdal.
This article has referenced many materials (mainly: http://www.cnblogs.com/Dormouse/articles/1422906.html) to write the compilation notes, support geos3.0.0, Visual C #2008, proj4.6.1, python2.5.
1. Download the source code.
1) download gdal1.6, decompress to C:/gdal-1.6.0. Http://trac.osgeo.org/gdal/wiki/DownloadSource)
2) download geos3.0.0, (http://trac.osgeo.org/geos)
3) download the swigwin-1.3.36 and unzip it to C:/gdal-1.6.0/swigwin-1.3.36. (Http://sourceforge.net/project/showfiles.php? Group_id = 1645)
4) download proj4.6.1 (http://trac.osgeo.org/proj)
2. Compile geos. Http://mateusz.loskot.net/2007/11/26/geos-300rc4-and-visual-c)
3. Compile proj.
1) C:/program files/Microsoft Visual Studio 8/VC> vcvars32.bat
2) nmake/F makefile. VC all
4. Modify the following content in nmake. Opt of gdal:
! Ifndef msvc_ver
# Assume msvc 9.0 # Or when using the nmake command: nmake-F makefile. VC msvc_ver = 1500
Msvc_ver = 1500
! Endif
-------------------------------------------
! Ifndef gdal_home
Gdal_home = "C:/gdal-1.6.0"
! Endif
Bindir = $ (gdal_home)/bin
Plugindir = $ (bindir)/gdalplugins
Py_inst_dir = "C:/python25/lib/Site-packages"
-------------------------------------------
# Set this to the installed directory containing python. If you don't
# Have Python just let it point to a directory that does not exist (as now ).
! Ifndef pydir
Pydir = "C:/python25"
! Endif
-------------------------------------------
# Uncomment for geos support
Geos_dir = C:/gdal-1.6.0/geos3.0.0
Geos_cflags =-I $ (geos_dir)/capi-I $ (geos_dir)/source/headers-dhave_geos
Geos_lib = $ (geos_dir)/source/geos_c_ I .lib
-------------------------------------------
In addition, there are two source files, which may cause compilation errors (frmts/leveller/levellerdataset. cpp and frmts/RMF/rmfdataset. cpp ).
Solution: open the file in Vs, then use IE to open the file, change the IE encoding to western Europe, and copy the code on the webpage to vs to save it.
5. Compile gdal
1) C:/program files/Microsoft Visual Studio 8/VC> vcvars32.bat
2) nmake/F makefile. VC
3) nmake/F makefile. VC install
4) namke/F makefile. VC devinstall
6. Copy the gdal16.dll generated in the root directory to the pymod and swip/CSHARP directories. Compile swip to generate gdal-wrap
1) Go To The swip/CSHARP directory and execute: nmake/F makefile. VC
7. The C # library includes:
Gdal16.dll, gdal_csharp.dll, ogr_csharp.dll, osr_csharp.dll, gdalconst_csharp.dll, gdal_wrap.dll, ogr_wrap.dll, osr_wrap.dll, Export
, Proj. dll, geos_c.dll
1) download: geos-3.0.0.rc4-makefile-fix.zip
2) nmake/F makefile. VC msvc_ver = 1400