pysal.lib.cg.point_touches_rectangle

pysal.lib.cg.point_touches_rectangle(point, rect)[源代码]

如果点在矩形中或触及其边界,则返回true。

point_touch_rectangle(point,rect)->bool

参数:
point : 点或Tuple
rect : 矩形

实例

>>> rect = Rectangle(0,0,10,10)
>>> a = Point((5,5))
>>> b = Point((10,5))
>>> c = Point((11,11))
>>> point_touches_rectangle(a,rect)
1
>>> point_touches_rectangle(b,rect)
1
>>> point_touches_rectangle(c,rect)
0