码迷,mamicode.com
首页 > 系统相关 > 详细

Ubuntu18.4—GDAL

时间:2019-02-09 19:30:53      阅读:487      评论:0      收藏:0      [点我收藏+]

标签:iso   export   ack   inux   glob   ble   file   ons   nump   


1.关闭SELinux
sudo apt-get install apparmor-profiles
sudo reboot
sudo systemctl stop apparmor-profiles

2.关闭防火墙
sudo ufw enable

3.安装Python3
zyx@ubuntu:/usr/bin$ sudo ln -s python3 python

sudo apt-get install python3

 

 

4.设定apt源
#备份
cp /etc/apt/sources.list /etc/apt/sources.list.bak

在/etc/apt/sources.list文件前面添加如下条目
#添加阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

最后执行如下命令更新源
##更新
sudo apt-get update
sudo apt-get upgrade


5.安装GDAL

sudo apt-get install libgdal-dev
sudo apt-get install gdal-bin

sudo apt-get install libgeos++-dev
sudo apt-get install libgeos
sudo apt-get install libgeos-dev
sudo apt-get install libgeotiff-dev
sudo apt-get install libgeotiff-epsg
sudo apt-get install libgeotiff2

sudo apt-get install libotb-dev

sudo apt-get install libsaga
sudo apt-get install libsaga-dev
sudo apt-get install libsaga-api
sudo apt-get install libsaga-gdi

sudo apt-get install mapserver-bin
sudo apt-get install cgi-mapserver
sudo apt-get install mapserver-doc

 

6.安装Python3-gdal

sudo apt-get install python3-pip

sudo apt-get install python3-pillow
  sudo apt-get install python3-numpy
  sudo apt-get install python3-matplotlib
  sudo apt-get install python3-gdal
  sudo apt-get install python3-shapely
  sudo apt-get install python3-polygon3
  sudo apt-get install python3-rtree

sudo apt-get install python3-pysal
sudo apt-get install python3-rasterio

sudo apt-get install python3-otb

sudo apt-get install python-saga

sudo apt-get install python-mapscript

 

7.另外安装
  sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple python_dateutil
  sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple protobuf
  sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple Pillow
  sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple pyparsing
  sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple kiwisolver

sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy
  sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple matplotlib

sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple pyproj
  sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple Shapely

 

https://gis.stackexchange.com/questions/28966/python-gdal-package-missing-header-file-when-installing-via-pip

export CPLUS_INCLUDE_PATH=/usr/include/gdal

export C_INCLUDE_PATH=/usr/include/gdal
gdal-config --version
export CFLAGS=$(gdal-config --cflags)

sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple --global-option=build_ext --global-option="-I/usr/include/gdal/" gdal==2.2.3

sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple Polygon3

sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple Rtree

sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple requests

Ubuntu18.4—GDAL

标签:iso   export   ack   inux   glob   ble   file   ons   nump   

原文地址:https://www.cnblogs.com/gispathfinder/p/10357788.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!