pysal.lib.cg.get_rectangle_point_intersect

pysal.lib.cg.get_rectangle_point_intersect(rect, pt)[source]

Returns the intersection of a rectangle and point.

get_rectangle_point_intersect(Rectangle, Point) -> Point

Parameters:
rect : a rectangle to check intersection for
pt : a point to check intersection for

Examples

>>> rect = Rectangle(0, 0, 5, 5)
>>> pt = Point((1, 1))
>>> i = get_rectangle_point_intersect(rect, pt)
>>> str(i)
'(1.0, 1.0)'
>>> pt2 = Point((10, 10))
>>> get_rectangle_point_intersect(rect, pt2)