ST_StartPoint
Name
ST_StartPoint — Returns the first point of a LineString.
Synopsis
geometry
ST_StartPoint
(
geometry
geomA
)
;
Description
Returns the first point of a
LINESTRING
or
CIRCULARLINESTRING
geometry
as a
POINT
or
NULL
if the input
parameter is not a
LINESTRING
or
CIRCULARLINESTRING
.
This method implements the SQL/MM specification. SQL-MM 3: 7.1.3
This function supports 3d and will not drop the z-index.
This method supports Circular Strings and Curves
Examples
SELECT ST_AsText(ST_StartPoint('LINESTRING(0 1, 0 2)'::geometry)); st_astext ------------ POINT(0 1) (1 row) SELECT ST_StartPoint('POINT(0 1)'::geometry) IS NULL AS is_null; is_null ---------- t (1 row) --3d line SELECT ST_AsEWKT(ST_StartPoint('LINESTRING(0 1 1, 0 2 2)'::geometry)); st_asewkt ------------ POINT(0 1 1) (1 row) -- circular linestring -- SELECT ST_AsText(ST_StartPoint('CIRCULARSTRING(5 2,-3 1.999999, -2 1, -4 2, 5 2)'::geometry)); st_astext ------------ POINT(5 2)