MCPcopy Create free account
hub / github.com/shapely/shapely / _path_from_polygon

Function _path_from_polygon

shapely/plotting.py:22–36  ·  view source on GitHub ↗
(polygon)

Source from the content-addressed store, hash-verified

20
21
22def _path_from_polygon(polygon):
23 from matplotlib.path import Path
24
25 from shapely.ops import orient
26
27 if isinstance(polygon, shapely.MultiPolygon):
28 return Path.make_compound_path(
29 *[_path_from_polygon(poly) for poly in polygon.geoms]
30 )
31 else:
32 polygon = orient(polygon)
33 return Path.make_compound_path(
34 Path(np.asarray(polygon.exterior.coords)[:, :2]),
35 *[Path(np.asarray(ring.coords)[:, :2]) for ring in polygon.interiors],
36 )
37
38
39def patch_from_polygon(polygon, **kwargs):

Callers 1

patch_from_polygonFunction · 0.85

Calls 1

orientFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…