shapely.prepare
shapely.prepare#
- prepare(geometry, **kwargs)#
Prepare a geometry, improving performance of other operations.
A prepared geometry is a normal geometry with added information such as an index on the line segments. This improves the performance of the following operations: contains, contains_properly, covered_by, covers, crosses, disjoint, intersects, overlaps, touches, and within.
Note that if a prepared geometry is modified, the newly created Geometry object is not prepared. In that case,
prepareshould be called again.This function does not recompute previously prepared geometries; it is efficient to call this function on an array that partially contains prepared geometries.
- Parameters
- geometryGeometry or array_like
Geometries are changed inplace
- **kwargs
For other keyword-only arguments, see the NumPy ufunc docs.
See also
is_preparedIdentify whether a geometry is prepared already.
destroy_preparedDestroy the prepared part of a geometry.