Renvoie une sous-partie d'un objet LineString spécifié.
Syntaxe
geometry ST_LineSubstring(geometry aLinestring , float8 startfraction , float8 endfraction);
geography ST_LineSubstring(geography aLinestring , float8 startfraction , float8 endfraction);
Paramètres
|
Nom du paramètre |
Description |
|
aLinestring |
L'objet LineString cible. |
|
startfraction |
La position de départ. |
|
endfraction |
La position de fin. |
Description
Lorsque les valeurs de startfraction et endfraction sont identiques, cette fonction équivaut à ST_LineInterpolatePoint.
Pour appliquer cette fonction à un objet MultiLineString, fusionnez-le d'abord à l'aide de ST_LineMerge.
Cette fonction prend en charge les objets 3D et conserve la coordonnée Z.
Cette fonction prend en charge les coordonnées M.
Exemple
SELECT ST_AsText(ST_LineSubstring('LINESTRING(0 0,10 10)'::geometry,0.3,0.6));
st_astext
---------------------
LINESTRING(3 3,6 6)
(1 row)
--geography
SELECT ST_AsText(ST_LineSubstring('LINESTRING(0 0,10 10)'::geography,0.3,0.6));
st_astext
--------------------------------------------------------------------------------
LINESTRING(2.97227762767668 3.01417970957332,5.96094221033023 6.0199989936211)