How to use the pygeos.GeometryType 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
>>> union_all([[line_1, line_2, None]], axis=1).tolist()
    []
    """
    # for union_all, GEOS provides an efficient route through first creating
    # GeometryCollections
    # first roll the aggregation axis backwards
    geometries = np.asarray(geometries)
    if axis is None:
        geometries = geometries.ravel()
    else:
        geometries = np.rollaxis(
            np.asarray(geometries), axis=axis, start=geometries.ndim
        )
    # create_collection acts on the inner axis
    collections = lib.create_collection(geometries, GeometryType.GEOMETRYCOLLECTION)
    return lib.unary_union(collections, **kwargs)
github pygeos / pygeos / pygeos / creation.py View on Github external
def multipoints(geometries):
    """Create multipoints from arrays of points

    Parameters
    ----------
    geometries : array_like
        An array of points or coordinates (see points).
    """
    geometries = np.asarray(geometries)
    if not isinstance(geometries, Geometry) and np.issubdtype(
        geometries.dtype, np.number
    ):
        geometries = points(geometries)
    return lib.create_collection(geometries, GeometryType.MULTIPOINT)