Name

ST_EndPoint — Returns a Point containing the last Point of a LineString

Synopsis

geometry ST_EndPoint(bytea Geometry);

Alias

EndPoint

Description

Returns a Point containing the last Point of a LineString. If the input geometry is not a LineString, null is returned.

[Note]

Also works with MultiLineStrings. In this case, returns the last point of the last LineString.

Coordinate Dimensions
2D3DM
Spatial Standards Support
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.17.2.12.17.2.10.17.1.4

Examples

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)

Related functions

ST_StartPoint