编译带有PROJ4和GEOS模块的GDAL

1、下载三个软件的源代码(去各自官网下载即可)

2、将PROJ4和GEOS的源码放到GDAL目录下的supportlibs文件夹中。

3、修改GDAL的nmake.opt文件,部分内容如下:

# Uncomment for GEOS support (GEOS >= 3.1.0 required)
GEOS_DIR=E:\code\gdal-1.11.3\supportlibs\geos-3.4.2
GEOS_CFLAGS = -I$(GEOS_DIR)/capi -I$(GEOS_DIR)/include -DHAVE_GEOS
GEOS_LIB     = $(GEOS_DIR)/src/geos_c_i.lib


# PROJ.4 stuff
# Uncomment the following lines to link PROJ.4 library statically. Otherwise
# it will be linked dynamically during runtime.
PROJ_FLAGS = -DPROJ_STATIC
PROJ_INCLUDE = -IE:\code\gdal-1.11.3\supportlibs\proj.4\src
PROJ_LIBRARY = E:\code\gdal-1.11.3\supportlibs\proj.4\src\proj_i.lib

4、同时参考我上一篇文章,注意GEOS和PROJ4的nmake.opt文件的修改。

5、最后,打开“Visual Studio x64 Win64 命令提示(2010)”,逐条使用以下命令进行编译。

vcvars64.bat
E:
cd E:\code\gdal-1.11.3\supportlibs\geos-3.4.2
nmake /f makefile.vc MSVC_VER=1600 release=1
cd E:\code\gdal-1.11.3\supportlibs\proj.4
nmake /f makefile.vc MSVC_VER=1600 release=1
cd ..
cd ..
nmake /f makefile.vc MSVC_VER=1600 release=1
nmake /f makefile.vc MSVC_VER=1600 release=1 devinstall

 

题外话:

1、在alpine linux中搭建gdal开发环境

apk add gdal gdal-dev gdal-driver-all gdal-tools java-gdal python3-gdal geos geos-dev proj proj-dev

 

posted @ 2015-11-27 15:24  松山居士  阅读(496)  评论(0)    收藏  举报