shapely.is_simple

Contents

shapely.is_simple#

is_simple(geometry, **kwargs)#

Returns True if a Geometry has no anomalous geometric points, such as self-intersections or self tangency.

Note that polygons and linearrings are assumed to be simple. Use is_valid to check these kind of geometries for self-intersections.

Parameters:
geometryGeometry or array_like

This function will return False for geometrycollections.

**kwargs

See NumPy ufunc docs for other keyword arguments.

See also

is_ring

Checks additionally if the geometry is closed.

is_valid

Checks whether a geometry is well formed.

Examples

>>> from shapely import LineString, Polygon
>>> is_simple(Polygon([(1, 1), (2, 1), (2, 2), (1, 1)]))
True
>>> is_simple(LineString([(0, 0), (1, 1), (0, 1), (1, 0), (0, 0)]))
False
>>> is_simple(None)
False