libpysal.cg.point_touches_rectangle¶
- libpysal.cg.point_touches_rectangle(point, rect)[source]¶
Returns
True
(1
) if the point is in the rectangle or touches it’s boundary, otherwiseFalse
(0
).- Parameters:
- point{
libpysal.cg.Point
,tuple
} A point or point coordinates.
- rect
libpysal.cg.Rectangle
A rectangle.
- point{
- Returns:
- chflag
int
1
ifpoint
is in (or touches boundary of)rect
, otherwise0
.
- chflag
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