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 |
|---|---|
|
A |
Return Value¶
Returns the same geometry family as the input, preserving SRID metadata.
Usage Notes¶
Both SRID and
GEOMETRY32preservation are covered bygeo_srid.sqlandgeo_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;