名称

ST_CurveN — 返回复合曲线(CompoundCurve)中的第N个曲线几何体。

大纲

geometry ST_CurveN(geometry a_compoundcurve, integer index);

描述

返回复合曲线(CompoundCurve)中的第N个曲线几何体。索引从1开始。如果输入的几何体不是复合曲线,或者索引超出范围,则返回NULL。

该方法实现了SQL/MM规范。 SQL-MM 3: 8.2.6, 8.3.5

该函数支持 3d 并且不会丢失 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