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)
| 318 | |
| 319 | |
| 320 | def 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 | |
| 344 | class SplitOp: |
searching dependent graphs…