Returns the last point of a LineString geometry as a point geometry.
Syntax
geometry ST_EndPoint(geometry g);Parameters
| Parameter | Description |
|---|---|
g | The geometry object. |
Usage notes
Returns NULL if the input is not a LineString.
Supports 3D objects and preserves z coordinates.
Supports circular strings and curves.
Examples
SELECT ST_AsText(ST_EndPoint('LINESTRING(0 0,2 2)'::geometry));Output:
st_astext
------------
POINT(2 2)
(1 row)