pysal.lib.cg.point_touches_rectangle

pysal.lib.cg.point_touches_rectangle(point, rect)[source]

Returns True if the point is in the rectangle or touches it’s boundary.

point_touches_rectangle(point, rect) -> bool

Parameters:
point : Point or Tuple
rect : Rectangle

Examples

>>> 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