Deepin , Ubuntu安装gdal(附安装包网盘链接)
linux下安装gdal较为复杂,大致思路是首先配置gdal所需的c++和java环境,其次要安装swig、sqlite3、proj依赖包,然后用swig和ant编译gdal,最后配置生成的jar包和动态库即可完成安装。具体步骤如下:
1、配置c++环境
sudo apt-get install gcc
sudo apt-get install g++
2、配置java和ant环境
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
https://ant.apache.org/bindownload.cgi
下载tar.gz包,解压后配置/etc/profile
export JAVA_HOME=/home/java/jdk1.8.0_261
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export ANT_HOME=/home/ant/apache-ant-1.10.8
export PATH=${JAVA_HOME}/bin:$ANT_HOME/bin:$PATH
配置环境生效
source /etc/profile
配置软链接
sudo ln -s /home/java/jdk1.8.0_261/bin/java /usr/bin/java
sudo ln -s /home/ant/apache-ant-1.10.8/bin/ant /usr/bin/ant
3、分别下载swig、sqlite3、proj6、gdal的tar.gz包
http://www.swig.org/download.html
https://www.sqlite.org/download.html
https://download.osgeo.org/proj/
https://gdal.org/download.html
解压后 cd进如每个解压包分别执行
./configure
sudo make
sudo make install
sudo ldconfig
4、编译gdal
修改java.opt:
JAVA_HOME = /home/java/jdk1.8.0_261/
ANT_HOME=/home/ant/apache-ant-1.10.8/
编译
cd /swig/java
make
把gdal根目录/swig/java中生成的gdal.jar文件复制到{JAVA_HOME}/jre/lib/ext下,把*.so、.lo、.o、.la、.a 文件复制{JAVA_HOME}/jre/lib/amd64
在/etc/profile中添加
export LD_LIBRARY_PATH=.:$JAVA_HOME/jre/lib/amd64
配置生效
source /etc/profile
此过程在deepin v15下测试安装成功,如安装过程中有问题,也可参考以下链接的方法
所需包链接
网盘链接:
链接:https://pan.baidu.com/s/1lDjcVtb3kdb3rHvHSHM8QQ
提取码:a0zi
参考
1、https://www.baidu.com/link?url=iaj_V_oBGPb4iBUbl9rwp57wUDkM2N4dOglf05wwu5fK6Fm8lY2vZdRMV_zF2FHA&wd=&eqid=bc6bd8dc000190c8000000065f5f94fd
2、https://www.baidu.com/link?url=V0yRlHyrA_GaSbIgKskWAdgxlFlotT1ojFIhDp5YC1tdcocZmhS5UtIZt1SIVABuHUtAfR80xqw_uGAScPpo1K&wd=&eqid=bc6bd8dc000190c8000000065f5f94fd
3、https://www.baidu.com/link?url=LVA8mNVpUjrFVQAWsVvLbQKgQpEm9QMNe21U693Yw2Mu4imEdV7c9XOVGoi5PlGjUEXK5w45p61U1vEgma-zMK&wd=&eqid=dc75bbbd0015bd25000000045f5f7a1d
4、https://www.baidu.com/link?url=LVA8mNVpUjrFVQAWsVvLbQKgQpEm9QMNe21U693Yw2Mu4imEdV7c9XOVGoi5PlGjUEXK5w45p61U1vEgma-zMK&wd=&eqid=dc75bbbd0015bd25000000045f5f7a1d
5、https://blog.csdn.net/dikcychen2011/article/details/21969357
5、https://blog.csdn.net/qcxyliyong/article/details/103752110