ST_ENDPOINT()

All functions > GEOSPATIAL > ST_ENDPOINT()

Returns the last vertex of a LineString.

Signatures

End point

Returns: Last vertex of the line

ST_ENDPOINT(line: T) → GEOM_POINT or GEOG_POINT
sql
ParameterTypeRequiredDescription
lineTYesA LineString geometry or geography

With:

  • T : Custom types: GEOM_LINESTRING | GEOG_LINESTRING

Signature notes:

  • Input must be a LineString; other sub kinds return NULL
  • Returns NULL if the input is NULL or empty

Examples

FeatureQL
SELECT
    f1 := ST_ASTEXT(ST_ENDPOINT(ST_GEOMFROMTEXT('LINESTRING (0 0, 1 1, 2 0)'))) -- Last vertex of a line
;
Result
f1 VARCHAR
POINT (2 0)

Last update at: 2026/05/26 17:22:09