ST_STARTPOINT
返回 LineString 中的第一个 Point。
语法
ST_STARTPOINT(<geometry_or_geography>)
参数
返回类型
Geometry。
示例
GEOMETRY 示例
SELECT
ST_STARTPOINT(
ST_GEOMETRYFROMWKT(
'LINESTRING(1 1, 2 2, 3 3, 4 4)'
)
) AS pipeline_endpoint;
┌───────────────────┐
│ pipeline_endpoint │
├───────────────────┤
│ POINT(1 1) │
└───────────────────┘
GEOGRAPHY 示例
SELECT
ST_STARTPOINT(
ST_GEOGFROMWKT(
'LINESTRING(1 1, 2 2, 3 3, 4 4)'
)
) AS pipeline_startpoint;
┌─────────────────────┐
│ pipeline_startpoint │
├─────────────────────┤
│ POINT(1 1) │
└─────────────────────┘