All Products
Search
Document Center

PolarDB:ST_EndPoint

Last Updated:Mar 28, 2026

Returns the last point of a LineString geometry as a point geometry.

Syntax

geometry ST_EndPoint(geometry g);

Parameters

ParameterDescription
gThe 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)