shapely.is_simple

Contents

shapely.is_simple#

is_simple(geometry, **kwargs)#

Return True if the geometry is simple.

A simple 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.

This function will return False for geometrycollections.

Parameters:
geometryGeometry or array_like

Geometry or geometries to check.

**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