ST_EndPoint — Returns a Point containing the last Point of a LineString
geometry ST_EndPoint(bytea
Geometry);
Returns a Point containing the last Point of a LineString. If the input geometry is not a LineString, null is returned.
![]() | |
Also works with MultiLineStrings. In this case, returns the last point of the last LineString. |
| 2D | 3D | M |
|---|---|---|
![]() | ![]() | ![]() |
| OGC SFS for SQL. 1.1 (1999) | OGC SFS for SQL. 1.1.0 (2005) | OGC SFS for SQL. 1.2.0 (2006) | SQL-MM Part 3 |
|---|---|---|---|
| 2.1.5.1 | 7.2.12.1 | 7.2.10.1 | 7.1.4 |
SELECT ST_EndPoint(ST_GeomFromText('POINT (0 0)'));
--Result
null
SELECT ST_AsEWKT(ST_EndPoint(ST_GeomFromText('LINESTRING(0 0 0 -4,5 0 0 -4,10 0 10 -2)')));
--Result
POINT (10 0 10 -2)
SELECT ST_AsEWKT(ST_EndPoint(ST_GeomFromText('MULTILINESTRING ((10 48, 10 0),(16 0, 16 23, 16 48))')));
--Result
POINT (16 48)