Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def multipolygons(geometries):
"""Create multipolygons from arrays of polygons
Parameters
----------
geometries : array_like
An array of polygons or coordinates (see polygons).
"""
geometries = np.asarray(geometries)
if not isinstance(geometries, Geometry) and np.issubdtype(
geometries.dtype, np.number
):
geometries = polygons(geometries)
return lib.create_collection(geometries, GeometryType.MULTIPOLYGON)
def multilinestrings(geometries):
"""Create multilinestrings from arrays of linestrings
Parameters
----------
geometries : array_like
An array of linestrings or coordinates (see linestrings).
"""
geometries = np.asarray(geometries)
if not isinstance(geometries, Geometry) and np.issubdtype(
geometries.dtype, np.number
):
geometries = linestrings(geometries)
return lib.create_collection(geometries, GeometryType.MULTILINESTRING)