shapely.coverage_invalid_edges

shapely.coverage_invalid_edges#

coverage_invalid_edges(geometry, gap_width=0.0, **kwargs)#

Verify if a coverage is valid and return invalid edges.

Note

‘coverage_invalid_edges’ requires at least GEOS 3.12.0.

This functions returns linear indicators showing the location of invalid edges (if any) in each polygon in the input array.

The coverage is represented by an array of polygonal geometries with exactly matching edges and no overlap.

A valid coverage may contain holes (regions of no coverage). However, sometimes it might be desirable to detect narrow gaps as invalidities in the coverage. The gap_width parameter allows to specify the maximum width of gaps to detect. When gaps are detected, the coverage_is_valid function will return False and this function can be used to find the edges of those gaps.

Geometries that are not Polygon or MultiPolygon are ignored.

Added in version 2.1.0.

Parameters:
geometryarray_like

Array of geometries to verify.

gap_widthfloat, default 0.0

The maximum width of gaps to detect.

**kwargs

See NumPy ufunc docs for other keyword arguments.

Returns:
numpy.ndarray | shapely.Geometry