Skip to main content
Return the paths shared by each geometry and other. Input geometries must be LineString, LinearRing, or MultiLineString geometries. Each result is a GeometryCollection containing two MultiLineString geometries. The first contains paths traversed in the same direction by both inputs; the second contains paths traversed in opposite directions. The operation works in a 1-to-1 row-wise manner.

Signature

Parameters

GeoSeries or geometric object
required
The GeoSeries (elementwise) or geometric object to find shared paths with. It must contain only lineal geometries.
bool | None (default None)
default:"None"
If True, automatically align GeoSeries based on their indices. If False, pair values in their existing order. None defaults to True.

Returns

GeoSeries
This method follows PostGIS ST_SharedPaths dimensional semantics: non-empty shared paths retain Z when either input has Z, empty results are two-dimensional, and M coordinates are not retained. The native SQL function rejects mixed SRIDs. At this GeoPandas-compatible layer, differing CRS metadata emits a warning, coordinates are evaluated as-is, and the left CRS is retained.
See also
  • GeoSeries.get_geometry

Examples

Use get_geometry to select the same- or opposite-direction component from each result.