ST_StartPoint()

TL;DR

Use ST_StartPoint() to return the first point of a LINESTRING.

Returns the first point of a LINESTRING.

Syntax

ST_StartPoint(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

  • Both SRID and GEOMETRY32 preservation are covered by geo_srid.sql and geo_geometry32.sql.

Examples

DROP DATABASE IF EXISTS geo_startpoint_demo;
CREATE DATABASE geo_startpoint_demo;
USE geo_startpoint_demo;

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

DROP DATABASE geo_startpoint_demo;

See Also