shapely.is_ring#
- is_ring(geometry, **kwargs)#
Return True if a linestring is closed and simple.
This function will return False for non-linestrings.
- Parameters:
- geometryGeometry or array_like
Geometry or geometries to check.
- **kwargs
See NumPy ufunc docs for other keyword arguments.
See also
Examples
>>> import shapely >>> from shapely import LineString, Point >>> shapely.is_ring(Point(0, 0)) False >>> geom = LineString([(0, 0), (1, 1)]) >>> shapely.is_closed(geom), shapely.is_simple(geom), shapely.is_ring(geom) (False, True, False) >>> geom = LineString([(0, 0), (0, 1), (1, 1), (0, 0)]) >>> shapely.is_closed(geom), shapely.is_simple(geom), shapely.is_ring(geom) (True, True, True) >>> geom = LineString([(0, 0), (1, 1), (0, 1), (1, 0), (0, 0)]) >>> shapely.is_closed(geom), shapely.is_simple(geom), shapely.is_ring(geom) (True, False, False)