(g1, g2)
return(geom_factory(lgeos.methods['shared_paths'](g1._geom, g2._geom)))
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 the
       opposite direction for the two inputs.

    Parameters
    ----------
    g1 : geometry
        The first geometry
    g2 : geometry
        The second geometry
Find paths shared between the two given lineal geometries
Find paths shared between the two given lineal geometries
def shared_paths(g1, g2):
    """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 the
       opposite direction for the two inputs.

    Parameters
    ----------
    g1 : geometry
        The first geometry
    g2 : geometry
        The second geometry
    """
    if not isinstance(g1, LineString):
        raise TypeError("First geometry must be a LineString")
    if not isinstance(g2, LineString):
        raise TypeError("Second geometry must be a LineString")
    return(geom_factory(lgeos.methods['shared_paths'](g1._geom, g2._geom)))
def shared_paths ( g1 , g2 ) : if not isinstance ( g1 , LineString ) : raise TypeError ( "First geometry must be a LineString" ) if not isinstance ( g2 , LineString ) : raise TypeError ( "Second geometry must be a LineString" ) return ( geom_factory ( lgeos . methods [ 'shared_paths' ] ( g1 . _geom , g2 . _geom ) ) )