Rechercher dans le manuel MySQL
12.16.5 MySQL-Specific Functions That Create Geometry Values
MySQL provides a set of useful nonstandard functions for creating geometry values. The functions described in this section are MySQL extensions to the OpenGIS specification.
These functions produce geometry objects from either WKB values or
geometry objects as arguments. If any argument is not a proper WKB
or geometry representation of the proper object type, the return
value is NULL
.
For example, you can insert the geometry return value from
Point()
directly into a
POINT
column:
Constructs a
GeomCollection
value from the geometry arguments.GeomCollection()
returns all the proper geometries contained in the arguments even if a nonsupported geometry is present.GeomCollection()
with no arguments is permitted as a way to create an empty geometry. Also, functions such asST_GeomFromText()
that accept WKT geometry collection arguments understand both OpenGIS'GEOMETRYCOLLECTION EMPTY'
standard syntax and MySQL'GEOMETRYCOLLECTION()'
nonstandard syntax.GeomCollection()
andGeometryCollection()
are synonymous, withGeomCollection()
the preferred function.GeometryCollection(
g
[,g
] ...)Constructs a
GeomCollection
value from the geometry arguments.GeometryCollection()
returns all the proper geometries contained in the arguments even if a nonsupported geometry is present.GeometryCollection()
with no arguments is permitted as a way to create an empty geometry. Also, functions such asST_GeomFromText()
that accept WKT geometry collection arguments understand both OpenGIS'GEOMETRYCOLLECTION EMPTY'
standard syntax and MySQL'GEOMETRYCOLLECTION()'
nonstandard syntax.GeomCollection()
andGeometryCollection()
are synonymous, withGeomCollection()
the preferred function.Constructs a
LineString
value from a number ofPoint
or WKBPoint
arguments. If the number of arguments is less than two, the return value isNULL
.MultiLineString(
ls
[,ls
] ...)Constructs a
MultiLineString
value usingLineString
or WKBLineString
arguments.Constructs a
MultiPoint
value usingPoint
or WKBPoint
arguments.MultiPolygon(
poly
[,poly
] ...)Constructs a
MultiPolygon
value from a set ofPolygon
or WKBPolygon
arguments.Constructs a
Point
using its coordinates.Constructs a
Polygon
value from a number ofLineString
or WKBLineString
arguments. If any argument does not represent aLinearRing
(that is, not a closed and simpleLineString
), the return value isNULL
.
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-gis-mysql-specific-functions.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.