非要这样的原因: 用win下编译好的python 的gdal库, 在读取osm.pdf数据文件 Getlayer时,只能读"points", 其他的lines, multpolygons 读出的feature都是-1个
怀疑是
注意是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 之类的.
参考https://gist.github.com/robinkraft/2a8ee4dd7e9ee9126030
为了让geos和gdal都支持python binding 事先需要
安装:swig
sudo apt install swig
因为我是用单独安装的 python3.8 而不是 18.04自带的3.6
所以编译前需要
export PYTHON=/usr/local/bin/python3.8
因为聚焦于点/线/面 的定义与计算, 所以源码体积很小: 才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