libpysal.cg.get_polygon_point_intersect¶
- libpysal.cg.get_polygon_point_intersect(poly, pt)[source]¶
Returns the intersection of a polygon and point.
- Parameters:
- poly
libpysal.cg.Polygon
A polygon to check for an intersection.
- pt
libpysal.cg.Point
A point to check
poly
for an intersection.
- poly
- Returns:
- ret{
libpysal.cg.Point
,None
} The intersection of a
poly
andpt
if one exists, otherwiseNone
.
- ret{
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)