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

Function shared_paths

shapely/ops.py:320–341  ·  view source on GitHub ↗

Find paths shared between the two given lineal geometries. Returns a GeometryCollection with two elements: - First element is a MultiLineString containing shared paths with the same direction for both inputs. - Second element is a MultiLineString containing shared paths with th

(g1, g2)

Source from the content-addressed store, hash-verified

318
319
320def shared_paths(g1, g2):
321 """Find paths shared between the two given lineal geometries.
322
323 Returns a GeometryCollection with two elements:
324 - First element is a MultiLineString containing shared paths with the
325 same direction for both inputs.
326 - Second element is a MultiLineString containing shared paths with the
327 opposite direction for the two inputs.
328
329 Parameters
330 ----------
331 g1 : geometry
332 The first geometry
333 g2 : geometry
334 The second geometry
335
336 """
337 if not isinstance(g1, LineString):
338 raise GeometryTypeError("First geometry must be a LineString")
339 if not isinstance(g2, LineString):
340 raise GeometryTypeError("Second geometry must be a LineString")
341 return shapely.shared_paths(g1, g2)
342
343
344class SplitOp:

Callers 3

test_wrong_typeMethod · 0.90

Calls 1

GeometryTypeErrorClass · 0.90

Tested by 3

test_wrong_typeMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…