pysal.lib.cg.get_shared_segments

pysal.lib.cg.get_shared_segments(poly1, poly2, bool_ret=False)[源代码]

返回两个多边形共用的线段。

获取共享段(poly1,poly2)->列表

参数:
poly1 : 多边形
poly2 : 多边形

实例

>>> from pysal.lib.cg.shapes import Polygon
>>> x = [0, 0, 1, 1]
>>> y = [0, 1, 1, 0]
>>> poly1 = Polygon( list(map(Point,zip(x,y))) )
>>> x = [a+1 for a in x]
>>> poly2 = Polygon( list(map(Point,zip(x,y))) )
>>> get_shared_segments(poly1, poly2, bool_ret=True)
True