MySQL provides a set of useful nonstandard functions for creating geometry values. MySQL提供了一组有用的非标准函数来创建几何值。The functions described in this section are MySQL extensions to the OpenGIS specification.本节中描述的函数是OpenGIS规范的MySQL扩展。
These functions produce geometry objects from either WKB values or geometry objects as arguments. 这些函数从WKB值或几何体对象作为参数生成几何体对象。If any argument is not a proper WKB or geometry representation of the proper object type, the return value is 如果任何参数不是正确的WKB或正确对象类型的几何表示形式,则返回值为NULL
.NULL
。
For example, you can insert the geometry return value from 例如,可以将Point()
directly into a POINT
column:Point()
的几何体返回值直接插入到点列中:
INSERT INTO t1 (pt_col) VALUES(Point(1,2));
Constructs a 从几何参数构造GeomCollection
value from the geometry arguments.GeomCollection
值。
GeomCollection()
returns all the proper geometries contained in the arguments even if a nonsupported geometry is present.GeomCollection()
返回参数中包含的所有正确几何图形,即使存在不支持的几何图形。
允许使用不带参数的GeomCollection()
with no arguments is permitted as a way to create an empty geometry. GeomCollection()
创建空几何体。Also, functions such as 此外,接受WKT ST_GeomFromText()
that accept WKT geometry collection arguments understand both OpenGIS 'GEOMETRYCOLLECTION EMPTY'
standard syntax and MySQL 'GEOMETRYCOLLECTION()'
nonstandard syntax.geometry
集合参数的函数(如ST_GeomFromText()
)既理解OpenGIS的'GEOMETRYCOLLECTION EMPTY'
标准语法,也理解MySQL的'GEOMETRYCOLLECTION()'
非标准语法。
GeomCollection()
and GeometryCollection()
are synonymous, with GeomCollection()
the preferred function.GeomCollection()
和GeometryCollection()
是同义词,GeomCollection()
是首选函数。
GeometryCollection(
g
[, g
] ...)
Constructs a 从GeomCollection
value from the geometry arguments.geometry
参数构造GeomCollection
值。
GeometryCollection()
returns all the proper geometries contained in the arguments even if a nonsupported geometry is present.GeometryCollection()
返回参数中包含的所有正确几何图形,即使存在不支持的几何图形。
允许使用不带参数的GeometryCollection()
with no arguments is permitted as a way to create an empty geometry. GeometryCollection()
创建空几何体。Also, functions such as 此外,接受WKT geometry集合参数的函数(如ST_GeomFromText()
that accept WKT geometry collection arguments understand both OpenGIS 'GEOMETRYCOLLECTION EMPTY'
standard syntax and MySQL 'GEOMETRYCOLLECTION()'
nonstandard syntax.ST_geometryfromtext()
)既理解OpenGIS的'GEOMETRYCOLLECTION EMPTY'
标准语法,也理解MySQL的'GEOMETRYCOLLECTION()'
非标准语法。
GeomCollection()
and GeometryCollection()
are synonymous, with GeomCollection()
the preferred function.GeomCollection()
和GeometryCollection()
是同义词,GeomCollection()
是首选函数。
Constructs a 从多个LineString
value from a number of Point
or WKB Point
arguments. Point
或WKB Point
参数构造LineString
值。If the number of arguments is less than two, the return value is 如果参数数少于2,则返回值为NULL
.NULL
。
MultiLineString(
ls
[, ls
] ...)
Constructs a 使用MultiLineString
value using LineString
or WKB LineString
arguments.LineString
或WKB LineString
参数构造MultiLineString
值。
Constructs a 使用MultiPoint
value using Point
or WKB Point
arguments.Point
或WKB Point
参数构造MultiPoint
值。
MultiPolygon(
poly
[, poly
] ...)
Constructs a 从一组MultiPolygon
value from a set of Polygon
or WKB Polygon
arguments.Polygon
或WKB Polygon
参数构造一个MultiPolygo
n值。
Constructs a 使用Point
using its coordinates.Point
的坐标构造Point
。
Constructs a 从多个Polygon
value from a number of LineString
or WKB LineString
arguments. LineString
或WKB LineString
参数构造Polygon
值。If any argument does not represent a 如果任何参数不表示LinearRing
(that is, not a closed and simple LineString
), the return value is NULL
.LinearRing
(即,不是闭合的简单LineString
),则返回值为NULL
。