shapely.is_closed#

is_closed(geometry, **kwargs)#

Returns True if a linestring’s first and last points are equal.

Parameters
geometryGeometry or array_like

This function will return False for non-linestrings.

**kwargs

For other keyword-only arguments, see the NumPy ufunc docs.

See also

is_ring

Checks additionally if the geometry is simple.

Examples

>>> from shapely import LineString, Point
>>> is_closed(LineString([(0, 0), (1, 1)]))
False
>>> is_closed(LineString([(0, 0), (0, 1), (1, 1), (0, 0)]))
True
>>> is_closed(Point(0, 0))
False