简体   繁体   English

匀称和几何中断距离法

[英]shapely and geos break in distance method

I'm having problems using the distance method in shapely (I suspect incompatibility with the geos package). 我在使用距离方法时遇到了问题(我怀疑与geos包不兼容)。

The following code: 如下代码:

from shapely.geometry import Point
print Point(0,0).distance(Point(1,1))

creates the following error: 产生以下错误:

python: GeometryComponentFilter.cpp:34: virtual void geos::geom::GeometryComponentFilter::filter_ro(const geos::geom::Geometry*): Assertion `0' failed.
Aborted (core dumped)

I'm running CentOS 6, python 2.6, geos 3.4.2 (although it creates a link from libgeos_c to 1.8.2) 我正在运行CentOS 6,python 2.6,geos 3.4.2(尽管它创建了从libgeos_c到1.8.2的链接)

Googling it yielded a few old posts which didn't really help me. 谷歌搜索它产生了一些旧的帖子,并没有真正帮助我。

Thanks, Raz 谢谢,拉兹

This looks like a GEOS bug ( #535 ). 这看起来像是GEOS错误( #535 )。 As a work around, try fetching a development snapshot that appears to solve this issue : 解决方法是,尝试获取似乎可以解决此问题的开发快照:

svn co http://svn.osgeo.org/geos/trunk@3960 geos-svn
cd geos-svn
./autogen.sh
./configure
make
make check

If the last command throws any similar errors, consider contributing feedback to the bug report. 如果最后一个命令抛出任何类似的错误,请考虑将反馈反馈给错误报告。 But if all is good, then it should be good for shapely. 但是,如果一切都好,那么它应该对身材好。 As root: 作为根:

make install
ldconfig

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM