Spatial Analysis Functions
991
+-------------------------------------------------------+
| AsText(Envelope(GeomFromText('LineString(1 1,2 2)'))) |
+-------------------------------------------------------+
| POLYGON((1 1,2 1,2 2,1 2,1 1)) |
+-------------------------------------------------------+
•
GeometryType(g)
[991]
Returns as a binary string the name of the geometry type of which the geometry instance
g
is a
member. The name corresponds to one of the instantiable
Geometry
subclasses.
mysql>
SELECT GeometryType(GeomFromText('POINT(1 1)'));
+------------------------------------------+
| GeometryType(GeomFromText('POINT(1 1)')) |
+------------------------------------------+
| POINT |
+------------------------------------------+
•
SRID(g)
[991]
Returns an integer indicating the Spatial Reference System ID for the geometry value
g
.
In MySQL, the SRID value is just an integer associated with the geometry value. All calculations are
done assuming Euclidean (planar) geometry.
mysql>
SELECT SRID(GeomFromText('LineString(1 1,2 2)',101));
+-----------------------------------------------+
| SRID(GeomFromText('LineString(1 1,2 2)',101)) |
+-----------------------------------------------+
| 101 |
+-----------------------------------------------+
The OpenGIS specification also defines the following functions, which MySQL does not implement:
•
Boundary(g)
[991]
Returns a geometry that is the closure of the combinatorial boundary of the geometry value
g
.
•
IsEmpty(g)
[991]
This function is a placeholder that returns 0 for any valid geometry value, 1 for any invalid geometry
value or
NULL
.
MySQL does not support GIS
EMPTY
values such as
POINT EMPTY
.
•
IsSimple(g)
[991]
In MySQL 5.0, this function is a placeholder that always returns 0.
The description of each instantiable geometric class given earlier in the chapter includes the specific
conditions that cause an instance of that class to be classified as not simple. (See
Section 12.16.2.1,
“The Geometry Class Hierarchy”
.)
12.16.5.2.2.
Point
Functions
A
Point
consists of X and Y coordinates, which may be obtained using the following functions:
•
X(p)
[991]
Returns the X-coordinate value for the
Point
object
p
as a double-precision number.
mysql>
SELECT X(POINT(56.7, 53.34));
+-----------------------+
| X(POINT(56.7, 53.34)) |
+-----------------------+
| 56.7 |
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 ...