The MySQL space extension not only provides storage capacity for spatial data, but also has some spatial computing capabilities, which are implemented through MySQL's built-in geometric functions. The simplest geometric functions have been involved yesterday, namely the conversion of WTK Geomfromtext and Astext. In addition, different geometric objects also have different function functions.
Functions of the Geometry class
DIMENSION, returns the size of the object, 1 is empty, 0 is a point (no length no area), 1 is a line (with length without area), and 2 is a polygon (area);
ENVELOPE, returns the minimum bounding rectangle;
Geomerytype, returning geometry type (string)
The Srid, the so-called Srid, is a spatial datum coordinate indicator that represents a coordinate system of a geometry type.
Function of the Point object
x, y two functions are used to return a point with its y-coordinate
Functions for Line objects
Glength, return line length
ISCLOSED, whether it is a closed segment
Numpoints, segment contains the number of points
STARTPOINT,ENDPOINT,POINTN, returning the start, end, and point at the specified position, respectively
Functions for Polygon objects
Area, return polygon size
exteriorring, returns the outer ring of the Linetype
INTERIORRINGN, returns the specified inner ring (for polygons that contain voids)
Numinteriorrings, returns the number of holes
Functions for geometric collection objects
Geometryn, returns the geometry type at the specified position
Numgeometries, returns the number of objects
Spatial analysis Operation function
OpenGIS's spatial analysis operation function is not yet fully supported by MySQL, including buffers, unions, and cutting operations that cannot be done directly through MySQL.
Minimum bounding rectangle spatial relation function
MySQL provides a set of functions to determine the positional relationship between several objects and the minimum bounding rectangle
Mbrcontains
Mbrdisjoint
Mbrequal
Mbrintersects
Mbroverlaps
Mbrtouches
Mbrwithin
Geometric Object spatial Relationship function
MySQL5 has not yet implemented spatial relationship analysis for the following geometry objects.
CONTAINS
Crosses
Disjoint
DISTANCE
EQUALS
Intersects
Overlaps
Related
Touches
Within
GIS geometric functions and spatial analysis functions in MySQL