首页 > 系统服务 > 详细

install gdal geos proj from source on ubuntu

时间:2020-02-24 13:14:13      阅读:144      评论:0      收藏:0      [点我收藏+]

非要这样的原因:   用win下编译好的python 的gdal库, 在读取osm.pdf数据文件 Getlayer时,只能读"points", 其他的lines, multpolygons 读出的feature都是-1个

怀疑是

几个库的关系:

GEOS:

注意是Geometry Engine, Open Source

https://trac.osgeo.org/geos/#GEOS-GeometryEngineOpenSource

不是Google Earth Overlay Server

(https://geos.readthedocs.io/en/latest/index.html#)

 

GEOS (Geometry Engine - Open Source) is a C++ port of the ?JTS Topology Suite (JTS). It aims to contain the complete functionality of JTS in C++.

 

This includes all the ?OpenGIS Simple Features for SQL spatial predicate functions and spatial operators, as well as specific JTS enhanced functions.

 

GEOS provides spatial functionality to many other projects and products.

字面意思是: 几何引擎开源. 

是JTS的C++版

包括空间预测函数和空间运算符, 

被大量其他项目和产品使用

地位基本相当于科学计算领域的BLAS,LAPACK. 所以,是基础设施的基础设施.  

 

 

 

gdal的地位约等于opencv,   要最后编译, 带上 各种 编译选项  --with-geos  python 之类的.

 

2编译与安装

参考https://gist.github.com/robinkraft/2a8ee4dd7e9ee9126030

为了让geos和gdal都支持python binding 事先需要

https://stackoverflow.com/questions/49234367/trying-to-install-geos-for-basemap-python-python-bindings-false

安装:swig

sudo apt install swig

因为我是用单独安装的 python3.8 而不是 18.04自带的3.6

所以编译前需要

export PYTHON=/usr/local/bin/python3.8
 

2.1  geos

因为聚焦于点/线/面 的定义与计算, 所以源码体积很小: 才2M

在这里下载最新版

http://download.osgeo.org/geos/

cd ~
wget http://download.osgeo.org/geos/geos-3.8.0.tar.bz2
bunzip2 geos-3.8.0.tar.bz2
tar xvf  geos-3.8.0.tar

cd geos-3.8.0
./configure --enable-shared --enable-python
make
sudo make install
sudo ldconfig

 

install gdal geos proj from source on ubuntu

原文:https://www.cnblogs.com/xuanmanstein/p/12356020.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!