ST_EndPoint()

TL;DR

Use ST_EndPoint() to return the last point of a LINESTRING.

Returns the last point of a LINESTRING.

Syntax

ST_EndPoint(linestring)

Arguments

Argument

Description

linestring

A GEOMETRY or GEOMETRY32 LINESTRING value.

Return Value

Returns the same geometry family as the input, preserving SRID metadata.

Usage Notes

  • The registered overloads also support GEOMETRY32.

Examples

DROP DATABASE IF EXISTS geo_endpoint_demo;
CREATE DATABASE geo_endpoint_demo;
USE geo_endpoint_demo;

SELECT ST_AsText(ST_EndPoint(ST_GeomFromText('LINESTRING(7 8,9 10,11 12)'))) AS end_point;

DROP DATABASE geo_endpoint_demo;

See Also