ST_SharedPaths — Renvoie une collection contenant les chemins partagés par les deux lignes/multilignes en entrée.
geometry ST_SharedPaths(geometry lineal1, geometry lineal2);
Renvoie une collection contenant les chemins partagés par les deux géométries d'entrée. Ceux qui vont dans la même direction sont dans le premier élément de la collection, ceux qui vont dans la direction opposée sont dans le deuxième élément. Les chemins eux-mêmes sont donnés dans la direction de la première géométrie.
Effectué par le module GEOS.
Disponibilité : 2.0.0
Adjacent shared path segments may be returned as separate or merged LineStrings depending on the GEOS version.
Find the shared paths of a MultiLineString and a LineString.
SELECT ST_SharedPaths(ST_GeomFromText('MULTILINESTRING((26 125,26 200,126 200,126 125,26 125),
(51 150,101 150,76 175,51 150))'),
ST_GeomFromText('LINESTRING(151 100,126 156.25,126 125,101 150,76 175)')
)
GEOMETRYCOLLECTION(MULTILINESTRING((126 156.25,126 125), (101 150,76 175)),MULTILINESTRING EMPTY)
0107000000020000000105000000020000000102000000020000000000000000805F4000000000008863400000000000805F400000000000405F4001020000000200000000000000004059400000000000C0624000000000000053400000000000E06540010500000000000000
Flip the LineString orientation to return the same paths in the opposite-direction member.
SELECT ST_SharedPaths(ST_GeomFromText('LINESTRING(76 175,101 150,126 125,126 156.25,151 100)'),
ST_GeomFromText('MULTILINESTRING((26 125,26 200,126 200,126 125,26 125),
(51 150,101 150,76 175,51 150))')
)
GEOMETRYCOLLECTION(MULTILINESTRING EMPTY, MULTILINESTRING((76 175,101 150),(126 125,126 156.25)))
01070000000200000001050000000000000001050000000200000001020000000200000000000000000053400000000000E0654000000000004059400000000000C062400102000000020000000000000000805F400000000000405F400000000000805F400000000000886340