Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Learn about LINESTRING properties in MariaDB Server. This section details SQL functions for retrieving attributes of linear spatial objects, such as length, number of points, and start/end points.
Returns the count of Points in a LineString. This function calculates the total number of vertices defining the line.
ST_NumPoints(ls)
NumPoints(ls)Returns the number of Point objects in the LineString value ls.
ST_NumPoints() and NumPoints() are synonyms.
This page is licensed: GPLv2, originally from
Synonym for ST_ENDPOINT. Returns the last point of a LineString geometry.
A synonym for ST_ENDPOINT.
This page is licensed: CC BY-SA / Gnu FDL
SET @ls = 'LineString(1 1,2 2,3 3)';
SELECT NumPoints(GeomFromText(@ls));
+------------------------------+
| NumPoints(GeomFromText(@ls)) |
+------------------------------+
| 3 |
+------------------------------+Synonym for ST_STARTPOINT. Returns the first point of a LineString geometry.
A synonym for ST_STARTPOINT.
This page is licensed: CC BY-SA / Gnu FDL
Synonym for ST_POINTN. Returns the N-th point in a LineString geometry, where N is a 1-based index.
A synonym for ST_PointN.
This page is licensed: CC BY-SA / Gnu FDL
ST_EndPoint() and EndPoint() are synonyms.
This page is licensed: GPLv2, originally from fill_help_tables.sql
ST_EndPoint(ls)
EndPoint(ls)SET @ls = 'LineString(1 1,2 2,3 3)';
SELECT AsText(EndPoint(GeomFromText(@ls)));
+-------------------------------------+
| AsText(EndPoint(GeomFromText(@ls))) |
+-------------------------------------+
| POINT(3 3) |
+-------------------------------------+Returns the start Point of a LineString. This function retrieves the initial coordinate in the linear geometry sequence.
ST_StartPoint(ls)
StartPoint(ls)Returns the Point that is the start point of the LineString value ls.
ST_StartPoint() and StartPoint() are synonyms.
This page is licensed: GPLv2, originally from
Synonym for ST_NUMPOINTS. Returns the number of points in a LineString geometry.
A synonym for ST_NumPoints.
This page is licensed: CC BY-SA / Gnu FDL
SET @ls = 'LineString(1 1,2 2,3 3)';
SELECT AsText(StartPoint(GeomFromText(@ls)));
+---------------------------------------+
| AsText(StartPoint(GeomFromText(@ls))) |
+---------------------------------------+
| POINT(1 1) |
+---------------------------------------+Synonym for ST_LENGTH. Calculates the length of a LineString or MultiLineString in its associated spatial reference units.
GLength(ls)Returns as a double-precision number the length of the LineString value ls in its associated spatial reference.
is the OpenGIS equivalent.
This page is licensed: GPLv2, originally from
SET @ls = 'LineString(1 1,2 2,3 3)';
SELECT GLength(GeomFromText(@ls));
+----------------------------+
| GLength(GeomFromText(@ls)) |
+----------------------------+
| 2.82842712474619 |
+----------------------------+Returns the N-th Point in a LineString. This function retrieves a specific point from the sequence based on its 1-based index.
ST_PointN(ls,N)
PointN(ls,N)Returns the N-th Point in the LineString value ls. Points are numbered beginning with 1.
ST_PointN() and PointN() are synonyms.
This page is licensed: GPLv2, originally from
SET @ls = 'LineString(1 1,2 2,3 3)';
SELECT AsText(PointN(GeomFromText(@ls),2));
+-------------------------------------+
| AsText(PointN(GeomFromText(@ls),2)) |
+-------------------------------------+
| POINT(2 2) |
+-------------------------------------+