STV_LineStringPoint

检索线串或线串集合的顶点。 根据输入对象的类型,返回的值为 GEOMETRY 或 GEOGRAPHY 类型的点。GEOMETRY 点将继承输入对象的 SRID。

STV_LineStringPoint 为分析函数。有关详细信息,请参阅分析函数

行为类型

不可变

语法

STV_LineStringPoint( g )
    OVER( [PARTITION NODES] ) AS

参数

g
线串或线串集合,GEOMETRY 或 GEOGRAPHY 类型的值

返回

GEOMETRY 或 GEOGRAPHY

支持的数据类型

示例

以下示例显示了 STV_LineStringPoint 的用法。

返回几何线串的顶点及其 SRID:

=> SELECT ST_AsText(Point), ST_SRID(Point)
     FROM (SELECT STV_LineStringPoint(
           ST_GeomFromText('MULTILINESTRING((1 2, 2 3, 3 1, 4 2),
                  (10 20, 20 30, 30 10, 40 20))', 4269)) OVER () AS Point) AS foo;
    ST_AsText   | ST_SRID
 ---------------+---------
  POINT (1 2)   |    4269
  POINT (2 3)   |    4269
  POINT (3 1)   |    4269
  POINT (4 2)   |    4269
  POINT (10 20) |    4269
  POINT (20 30) |    4269
  POINT (30 10) |    4269
  POINT (40 20) |    4269
 (8 rows)

返回地理线串的顶点:


=> SELECT ST_AsText(g)
     FROM (SELECT STV_LineStringPoint(
       ST_GeographyFromText('MULTILINESTRING ((42.1 71.0, 41.4 70.0, 41.3 72.9),
           (42.99 71.46, 44.47 73.21)', 4269)) OVER () AS g) AS line_geog_points;
      ST_AsText
---------------------
 POINT (42.1 71.0)
 POINT (41.4 70.0)
 POINT (41.3 72.9)
 POINT (42.99 71.46)
 POINT (44.47 73.21)
(5 rows)

另请参阅

STV_PolygonPoint