shapely.is_prepared

Contents

shapely.is_prepared#

is_prepared(geometry, **kwargs)#

Return True if a Geometry is prepared.

Note that it is not necessary to check if a geometry is already prepared before preparing it. It is more efficient to call prepare directly because it will skip geometries that are already prepared.

This function will return False for missing geometries (None).

Parameters:
geometryGeometry or array_like

Geometry or geometries to check.

**kwargs

See NumPy ufunc docs for other keyword arguments.

See also

is_valid_input

check if an object is a geometry or None

prepare

prepare a geometry

Examples

>>> import shapely
>>> from shapely import Point
>>> geometry = Point(0, 0)
>>> shapely.is_prepared(Point(0, 0))
False
>>> shapely.prepare(geometry)
>>> shapely.is_prepared(geometry)
True
>>> shapely.is_prepared(None)
False