GDAL编译,链接cUrl库(libCurl)
目录
一、环境
Windows 10, VS 2017
GDAL 2.40.0,cUrl 7.63.0
二、编译过程
1. 准备
- 下载cUrl
- 下载GDAL
2. 编译cUrl
命令行方式进入winbuild目录,运行:
nmake /f makefile.vc mode=dll machine=x64
3. 编译GDAL
- 修改nmake.opt文件
# Uncomment to use libcurl (DLL by default)
# The cURL library is used for WCS, WMS, GeoJSON, SRS call importFromUrl(), WFS, GFT, CouchDB, /vsicurl/ etc.
CURL_DIR=D:\OpenSources\cUrl\curl-7.63.0\builds\libcurl-vc15-x64-release-dll-ipv6-sspi-winssl
CURL_INC = -I$(CURL_DIR)/include
# Uncomment following line to use libcurl as dynamic library
CURL_LIB = $(CURL_DIR)/lib/libcurl.lib wsock32.lib wldap32.lib winmm.lib
# Uncomment following two lines to use libcurl as static library
#CURL_LIB = $(CURL_DIR)/libcurl.lib wsock32.lib wldap32.lib winmm.lib
- nmake -f makefile.vc
三、测试
- gdalinfo –format WMS
图1. 测试GDAL是否支持WMS格式
- gdalinfo –format WCS
图2. 测试GDAL是否支持WCS格式
- /vsicurl/ (http/https/ftp files: random access)
/vsicurl/ is a file system handler that allows on-the-fly random reading of files available throught HTTP/FTP web protocols, without prior download of the entire file. It requirs GDAL to be built against libculr.
测试示例:ogrinfo -ro -al -so /vsicurl/https://raw.githubusercontent.com/OSGeo/gdal/master/autotest/ogr/data/poly.shp
四、参考
- http://trac.osgeo.org/gdal/wiki/LibCurl
- http://blog.csdn.net/liminlu0314/article/details/7881285
- http://web.archiveorange.com/archive/v/myqjyjfGzN250uRH11KO (gdalinfo –format )
- Compile libcurl on Windows with Visual Studio 2017 and SSL (WinSSL): https://medium.com/@chuy.max/compile-libcurl-on-windows-with-visual-studio-2017-x64-and-ssl-winssl-cff41ac7971d
转载自:https://blog.csdn.net/hgsd0001/article/details/9855539