-
EndPoint(ls
)
Returns the Point
that is the endpoint
of the LineString
value
ls
.
mysql> SET @ls = 'LineString(1 1,2 2,3 3)';
mysql> SELECT AsText(EndPoint(GeomFromText(@ls)));
+-------------------------------------+
| AsText(EndPoint(GeomFromText(@ls))) |
+-------------------------------------+
| POINT(3 3) |
+-------------------------------------+
-
GLength(ls
)
Returns as a double-precision number the length of the
LineString
value
ls
in its associated spatial
reference.
mysql> SET @ls = 'LineString(1 1,2 2,3 3)';
mysql> SELECT GLength(GeomFromText(@ls));
+----------------------------+
| GLength(GeomFromText(@ls)) |
+----------------------------+
| 2.8284271247462 |
+----------------------------+
GLength()
is a non-standard name. It
corresponds to the OpenGIS Length()
function.
-
NumPoints(ls
)
Returns the number of Point
objects in
the LineString
value
ls
.
mysql> SET @ls = 'LineString(1 1,2 2,3 3)';
mysql> SELECT NumPoints(GeomFromText(@ls));
+------------------------------+
| NumPoints(GeomFromText(@ls)) |
+------------------------------+
| 3 |
+------------------------------+
-
PointN(ls
,N
)
Returns the N
-th
Point
in the
Linestring
value
ls
. Points are numbered
beginning with 1.
mysql> SET @ls = 'LineString(1 1,2 2,3 3)';
mysql> SELECT AsText(PointN(GeomFromText(@ls),2));
+-------------------------------------+
| AsText(PointN(GeomFromText(@ls),2)) |
+-------------------------------------+
| POINT(2 2) |
+-------------------------------------+
-
StartPoint(ls
)
Returns the Point
that is the start
point of the LineString
value
ls
.
mysql> SET @ls = 'LineString(1 1,2 2,3 3)';
mysql> SELECT AsText(StartPoint(GeomFromText(@ls)));
+---------------------------------------+
| AsText(StartPoint(GeomFromText(@ls))) |
+---------------------------------------+
| POINT(1 1) |
+---------------------------------------+