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
| Parameter | Type | Required | Description |
|---|---|---|---|
line | T | Yes | A 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) |
On this page