pysal.lib.cg.get_polygon_point_intersect

pysal.lib.cg.get_polygon_point_intersect(poly, pt)[source]

Returns the intersection of a polygon and point.

get_polygon_point_intersect(Polygon, Point) -> Point

Parameters:
poly : a polygon to check intersection for
pt : a point to check intersection for

Examples

>>> poly = Polygon([Point((0, 0)), Point((1, 0)), Point((1, 1)), Point((0, 1))])
>>> pt = Point((0.5, 0.5))
>>> i = get_polygon_point_intersect(poly, pt)
>>> str(i)
'(0.5, 0.5)'
>>> pt2 = Point((2, 2))
>>> get_polygon_point_intersect(poly, pt2)