ST_EndPoint — 返回LineString或CircularLineString的最后一点。
geometry ST_EndPoint(
geometry g)
;
的最后一个点。 LINESTRING
或 CIRCULARLINESTRING
几何体作为 POINT
。退货 NULL
如果输入不是 LINESTRING
或 CIRCULARLINESTRING
。
This method implements the SQL/MM specification. SQL-MM 3:7.1.4
This function supports 3d and will not drop the z-index.
This method supports Circular Strings and Curves
![]() | |
已更改:2.0.0不再适用于单个几何体多行字符串。在较早版本的PostGIS中,单行多行字符串将与此函数一起使用并返回终点。在2.0.0中,它像任何其他多行字符串一样返回NULL。旧的行为是一个没有文档记录的功能,但是那些认为他们的数据存储为LINESTRING的人可能会在2.0.0中遇到这些返回NULL的情况。 |
线条的终点
postgis=# SELECT ST_AsText(ST_EndPoint('LINESTRING(1 1, 2 2, 3 3)'::geometry)); st_astext ------------ POINT(3 3)
非线型字符串的终点为空
SELECT ST_EndPoint('POINT(1 1)'::geometry) IS NULL AS is_null; is_null ---------- t
三维线串的终点
--3d endpoint SELECT ST_AsEWKT(ST_EndPoint('LINESTRING(1 1 2, 1 2 3, 0 0 5)')); st_asewkt -------------- POINT(0 0 5)
圆形字符串的终点
SELECT ST_AsText(ST_EndPoint('CIRCULARSTRING(5 2,-3 1.999999, -2 1, -4 2, 6 3)'::geometry)); st_astext ------------ POINT(6 3)