shapely.point_on_surface

shapely.point_on_surface#

point_on_surface(geometry, **kwargs)#

Return a point that intersects an input geometry.

Parameters:
geometryGeometry or array_like

Geometry or geometries for which to compute a point on the surface.

**kwargs

See NumPy ufunc docs for other keyword arguments.

Examples

>>> import shapely
>>> from shapely import LineString, MultiPoint, Polygon
>>> shapely.point_on_surface(Polygon([(0, 0), (10, 0), (10, 10), (0, 10), (0, 0)]))
<POINT (5 5)>
>>> shapely.point_on_surface(LineString([(0, 0), (2, 2), (10, 10)]))
<POINT (2 2)>
>>> shapely.point_on_surface(MultiPoint([(0, 0), (10, 10)]))
<POINT (0 0)>
>>> shapely.point_on_surface(Polygon())
<POINT EMPTY>