11.4.4 Geometry Well-Formedness and Validity几何的良好形式性与有效性

For geometry values, MySQL distinguishes between the concepts of syntactically well-formed and geometrically valid.对于几何值,MySQL区分语法良好和几何有效的概念。

A geometry is syntactically well-formed if it satisfies conditions such as those in this (nonexhaustive) list:如果一个几何满足以下(非穷尽)列表中的条件,则它在语法上是良好的:

A geometry is geometrically valid if it is syntactically well-formed and satisfies conditions such as those in this (nonexhaustive) list:如果一个几何结构在语法上是良好的,并且满足以下(非穷尽)列表中的条件,那么它在几何上是有效的:

Spatial functions fail if a geometry is not syntactically well-formed. Spatial import functions that parse WKT or WKB values raise an error for attempts to create a geometry that is not syntactically well-formed. 如果一个几何体的语法结构不好,空间函数就会失效。解析WKT或WKB值的空间导入函数会导致尝试创建语法不正确的几何图形时出错。Syntactic well-formedness is also checked for attempts to store geometries into tables.还检查语法的良好形式,以尝试将几何图形存储到表中。

It is permitted to insert, select, and update geometrically invalid geometries, but they must be syntactically well-formed. Due to the computational expense, MySQL does not check explicitly for geometric validity. 允许插入、选择和更新几何上无效的几何图形,但它们必须具有良好的语法形式。由于计算开销,MySQL不会显式检查几何有效性。Spatial computations may detect some cases of invalid geometries and raise an error, but they may also return an undefined result without detecting the invalidity. 空间计算可能会检测到一些无效几何形状的情况并引发错误,但它们也可能在没有检测到无效的情况下返回未定义的结果。Applications that require geometically valid geometries should check them using the ST_IsValid() function.需要几何有效几何图形的应用程序应使用ST_IsValidat()函数进行检查。