Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""Create an array of polygons.
Parameters
----------
shell : array_like
An array of linearrings that constitute the out shell of the polygons.
Coordinates can also be passed, see linearrings.
holes : array_like
An array of lists of linearrings that constitute holes for each shell.
"""
shells = np.asarray(shells)
if not isinstance(shells, Geometry) and np.issubdtype(shells.dtype, np.number):
shells = linearrings(shells)
if holes is None:
return lib.polygons_without_holes(shells)
holes = np.asarray(holes)
if not isinstance(holes, Geometry) and np.issubdtype(holes.dtype, np.number):
holes = linearrings(holes)
return lib.polygons_with_holes(shells, holes)