GIS geometric functions and spatial analysis functions in MySQL

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.