Fork me on GitHub

ST_StartPoint

Signature

POINT ST_StartPoint(GEOMETRY geom);

Description

Returns the first coordinate of geom as a POINT, given that geom is a LINESTRING or a MULTILINESTRING containing only one LINESTRING. Returns NULL for all other Geometries.

Implements the OpenGIS Simple Features Implementation Specification for SQL version 1.2.1.

Example

SELECT ST_StartPoint('LINESTRING(1 2, 5 3, 2 6)');
-- Answer: POINT(1 2)

SELECT ST_StartPoint('MULTILINESTRING((1 1, 3 2, 3 1))');
-- Answer: POINT(1 1)

SELECT ST_StartPoint('MULTILINESTRING((1 1, 3 2, 3 1),
                                      (1 2, 5 3, 2 6))');
-- Answer: NULL
See also