Linux 安装GDAL
-i https://pypi.tuna.tsinghua.edu.cn/simple
-i https://mirrors.aliyun.com/pypi/simple
Linux 安装GDAL
下载:sqlite,proj,gdal
安装gdal前,要安装proj,安装proj时,报错,提示安装sqlite
安装sqlite
官网:https://www.sqlite.org/download.html
## 下载
wget -c -P /storage/software/gdal-related-libs https://www.sqlite.org/download.html/sqlite-autoconf-3410200.tar.gz
## 解压
tar -xvzf sqlite-autoconf-3410200.tar.gz
## 安装
./configure
make
make install
ldconfig
安装proj
官网:https://proj.org/download.html
## 下载
wget -c -P /storage/software/gdal-related-libs https://download.osgeo.org/proj/proj-8.1.0.tar.gz
## 解压
tar -xvzf proj-8.1.0.tar.gz
## 编译安装
./configure
make
make check
make install
安装GDAL
## 下载
wget -c -P /storage/software/gdal-related-libs http://download.osgeo.org/gdal/3.6.3/gdal-3.6.3.tar.gz
## 解压
tar -xvzf gdal-3.6.3.tar.gz
## 编译安装
教程:https://gdal.org/development/building_from_source.html
cd /storage/software/gdal-related-libs/gdal-3.6.3
// 建路径
mkdir build
cd build
cmake ..
cmake --build .
cmake --build . --target install
## 编写环境变量
apt update
apt-get install vim-gtk # 安装vim
vim /etc/profile
// 在export PATH下一行添加,依赖的动态库和静态库添加到LD_LIBRARY_PATH环境变量中去,
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib //
source /etc/profile // 重启
##查看GDAL版本信息
gdalinfo --version
安装 cmake
注意: GDAL>=3.5,要通过cmake编译安装
## 下载
wget -c -P /storage/software/gdal-related-libs https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2.tar.gz
## 解压
tar -zxvf cmake-3.13.2.tar.gz
## 编译安装
./bootstrap
make
make install