Python shapely和geos磨合距离法
我在shapely中使用距离方法时遇到问题(我怀疑与geos包不兼容) 以下代码:Python shapely和geos磨合距离法,python,geos,shapely,Python,Geos,Shapely,我在shapely中使用距离方法时遇到问题(我怀疑与geos包不兼容) 以下代码: from shapely.geometry import Point print Point(0,0).distance(Point(1,1)) 创建以下错误: python: GeometryComponentFilter.cpp:34: virtual void geos::geom::GeometryComponentFilter::filter_ro(const geos::geom::Geometry
from shapely.geometry import Point
print Point(0,0).distance(Point(1,1))
创建以下错误:
python: GeometryComponentFilter.cpp:34: virtual void geos::geom::GeometryComponentFilter::filter_ro(const geos::geom::Geometry*): Assertion `0' failed.
Aborted (core dumped)
我正在运行CentOS 6、python 2.6、geos 3.4.2(尽管它创建了从libgeos_c到1.8.2的链接)
在谷歌上搜索得到了一些对我没什么帮助的老帖子
谢谢,
Raz这看起来像一个GEOS bug()。作为解决方法,请尝试获取开发快照:
如果最后一个命令抛出任何类似的错误,请考虑向bug报告提供反馈。但如果一切都是好的,那么这对shapely来说应该是好的。根目录:
make install
ldconfig
您是如何安装GEOS和Shapely的?Shapely使用pip,GEOS下载zip文件,进行配置、制作和制作安装。谢谢。make检查没有抛出任何类似的错误(顺便说一句,我配置了--enable python)。但是,安装的版本仍然存在相同的问题。libgeos_c上的时间戳似乎是最近的,所以我希望我真的使用了最新的库。请尝试使用root
ldconfig
以确保动态库链接是最新的。我有一种感觉,它仍然是链接到一个旧的破碎的建设。另外,--enable python
已经很长一段时间没有通过GEOS直接支持了。ldconfig/usr/local/lib解决了这个问题。谢谢当不使用--enable python时,configure会显示:python绑定:false。这很好吗?是的,Python绑定从来没有直接从GEOS得到过支持。Shapely使用C-API。
make install
ldconfig