Spatial Analysis Functions
993
+-------------------------------------+
•
StartPoint(ls)
[993]
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) |
+---------------------------------------+
The OpenGIS specification also defines the following function, which MySQL does not implement:
•
IsRing(ls)
[993]
Returns 1 if the
LineString
value
ls
is closed (that is, its
StartPoint()
[993]
and
EndPoint()
[992]
values are the same) and is simple (does not pass through the same point
more than once). Returns 0 if
ls
is not a ring, and –1 if it is
NULL
.
12.16.5.2.4.
MultiLineString
Functions
These functions return properties of
MultiLineString
values.
•
GLength(mls)
[992]
Returns as a double-precision number the length of the
MultiLineString
value
mls
. The length
of
mls
is equal to the sum of the lengths of its elements.
mysql>
SET @mls = 'MultiLineString((1 1,2 2,3 3),(4 4,5 5))';
mysql>
SELECT GLength(GeomFromText(@mls));
+-----------------------------+
| GLength(GeomFromText(@mls)) |
+-----------------------------+
| 4.2426406871193 |
+-----------------------------+
GLength()
[992]
is a nonstandard name. It corresponds to the OpenGIS
Length()
[890]
function.
•
IsClosed(mls)
[993]
Returns 1 if the
MultiLineString
value
mls
is closed (that is, the
StartPoint()
[993]
and
EndPoint()
[992]
values are the same for each
LineString
in
mls
). Returns 0 if
mls
is not
closed, and –1 if it is
NULL
.
mysql>
SET @mls = 'MultiLineString((1 1,2 2,3 3),(4 4,5 5))';
mysql>
SELECT IsClosed(GeomFromText(@mls));
+------------------------------+
| IsClosed(GeomFromText(@mls)) |
+------------------------------+
| 0 |
+------------------------------+
12.16.5.2.5.
Polygon
Functions
These functions return properties of
Polygon
values.
•
Area(poly)
[993]
Returns as a double-precision number the area of the
Polygon
value
poly
, as measured in its
spatial reference system.
mysql>
SET @poly = 'Polygon((0 0,0 3,3 0,0 0),(1 1,1 2,2 1,1 1))';
mysql>
SELECT Area(GeomFromText(@poly));
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...