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
polyfor an intersection.
- Returns:¶
ret – The intersection of a
polyandptif one exists, otherwiseNone.- Return type:¶
{libpysal.cg.Point, None}
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)