How to use the pygeos.decorators.requires_geos function in pygeos

To help you get started, we’ve selected a few pygeos examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pygeos / pygeos / pygeos / set_operations.py View on Github external
@requires_geos("3.8.0")
@multithreading_enabled
def coverage_union_all(geometries, axis=0, **kwargs):
    """Returns the union of multiple polygons of a geometry collection.
    This is an optimized version of union which assumes the polygons
    to be non-overlapping.

    Requires at least GEOS 3.8.0.

    Parameters
    ----------
    geometries : array_like
    axis : int
        Axis along which the operation is performed. The default (zero)
        performs the operation over the first dimension of the input array.
        axis may be negative, in which case it counts from the last to the
        first axis.
github pygeos / pygeos / pygeos / measurement.py View on Github external
@requires_geos("3.7.0")
@multithreading_enabled
def frechet_distance(a, b, densify=None, **kwargs):
    """Compute the discrete Fréchet distance between two geometries.

    The Fréchet distance is a measure of similarity: it is the greatest
    distance between any point in A and the closest point in B. The discrete
    distance is an approximation of this metric: only vertices are considered.
    The parameter 'densify' makes this approximation less coarse by splitting
    the line segments between vertices before computing the distance.

    Fréchet distance sweep continuously along their respective curves
    and the direction of curves is significant. This makes it a better measure
    of similarity than Hausdorff distance for curve or surface matching.

    Parameters
    ----------
github pygeos / pygeos / pygeos / constructive.py View on Github external
@requires_geos("3.8.0")
@multithreading_enabled
def make_valid(geometry, **kwargs):
    """Repairs invalid geometries.

    Requires at least GEOS 3.8.0.

    Parameters
    ----------
    geometry : Geometry or array_like

    Examples
    --------
    >>> make_valid(Geometry("POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))"))
    
    """
    return lib.make_valid(geometry, **kwargs)
github pygeos / pygeos / pygeos / set_operations.py View on Github external
@requires_geos("3.8.0")
@multithreading_enabled
def coverage_union(a, b, **kwargs):
    """Merges multiple polygons into one. This is an optimized version of
    union which assumes the polygons to be non-overlapping.

    Requires at least GEOS 3.8.0.

    Parameters
    ----------
    a : Geometry or array_like
    b : Geometry or array_like

    See also
    --------
    coverage_union_all
github pygeos / pygeos / pygeos / constructive.py View on Github external
@requires_geos("3.8.0")
@multithreading_enabled
def build_area(geometry, **kwargs):
    """Creates an areal geometry formed by the constituent linework of given geometry.

    Equivalent of the PostGIS ST_BuildArea() function.

    Requires at least GEOS 3.8.0.

    Parameters
    ----------
    geometry : Geometry or array_like

    Examples
    --------
    >>> build_area(Geometry("GEOMETRYCOLLECTION(POLYGON((0 0, 3 0, 3 3, 0 3, 0 0)), POLYGON((1 1, 1 2, 2 2, 1 1)))"))