Назва

ST_CurveN — Повертає геометрію N-го компонента кривої CompoundCurve.

Короткий огляд

geometry ST_CurveN(geometry a_compoundcurve, integer index);

Опис

Повертає геометрію N-го компонента кривої CompoundCurve. Індекс починається з 1. Повертає NULL, якщо геометрія не є CompoundCurve або індекс знаходиться поза діапазоном.

This method implements the SQL/MM specification. SQL-MM 3: 8.2.6, 8.3.5

This function supports 3d and will not drop the z-index.

Приклади

This example extracts the second component curve, a CircularString, from a CompoundCurve.

Code
SELECT ST_CurveN(
  'COMPOUNDCURVE(
    (0 0,2 0),
    CIRCULARSTRING(2 0,3 1,4 0),
    (4 0,6 1)
  )',
  2) AS curve;
Вивід растрових зображень
CIRCULARSTRING(2 0,3 1,4 0)
Figure
Geometry figure for visual-st-curven-01