8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 13 种数据类型 / 13.4 空间数据类型
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

13.4 空间数据类型13.4 Spatial Data Types

开放地理空间联盟(OGC)是一个国际联盟,由 250 多家公司、机构和大学组成,参与开发可公开获得的概念解决方案,这些解决方案可在管理各种空间数据的应用中使用。The Open Geospatial Consortium (OGC) is an international consortium of more than 250 companies, agencies, and universities participating in the development of publicly available conceptual solutions that can be useful with all kinds of applications that manage spatial data.

开放地理空间联盟(OGC)发布了地理信息 - 简单要素访问 - 第 2 部分:SQL 选项的 OpenGIS®实施标准,该文档提出了几种将 SQL 关系型数据库管理系统扩展以支持空间数据的概念方法。该规范可从 OGC 网站获取,网址为http://www.opengeospatial.org/standards/sfs。The Open Geospatial Consortium publishes the OpenGIS® Implementation Standard for Geographic information - Simple feature access - Part 2: SQL option, a document that proposes several conceptual ways for extending an SQL RDBMS to support spatial data. This specification is available from the OGC website at http://www.opengeospatial.org/standards/sfs.

根据 OGC 规范,MySQL 将空间扩展作为带几何类型的 SQL环境的一个子集来实现。该术语指的是一个已扩展了一组几何类型的 SQL 环境。几何值类型的 SQL 列实现为具有几何类型的列。该规范描述了一组 SQL 几何类型,以及在这些类型上创建和分析几何值的函数。Following the OGC specification, MySQL implements spatial extensions as a subset of the SQL with Geometry Types environment. This term refers to an SQL environment that has been extended with a set of geometry types. A geometry-valued SQL column is implemented as a column that has a geometry type. The specification describes a set of SQL geometry types, as well as functions on those types to create and analyze geometry values.

MySQL 空间扩展支持地理特征的生成、存储和分析:MySQL spatial extensions enable the generation, storage, and analysis of geographic features:

  • 用于表示空间值的数据类型Data types for representing spatial values

  • 用于操作空间值的函数Functions for manipulating spatial values

  • 用于提高对空间列访问速度的空间索引Spatial indexing for improved access times to spatial columns

空间数据类型和函数可用于 MyISAM、InnoDB、NDB 和 ARCHIVE 表。对于空间列的索引,MyISAM 和 InnoDB 支持 SPATIAL 和非 SPATIAL 索引。其他存储引擎支持非 SPATIAL 索引,如 第 15.1.15 节,“CREATE INDEX 语句” 中所述。The spatial data types and functions are available for MyISAM, InnoDB, NDB, and ARCHIVE tables. For indexing spatial columns, MyISAM and InnoDB support both SPATIAL and non-SPATIAL indexes. The other storage engines support non-SPATIAL indexes, as described in Section 15.1.15, “CREATE INDEX Statement”.

一个 地理特征 是世界上任何具有位置的事物。一个特征可以是:A geographic feature is anything in the world that has a location. A feature can be:

  • 一个实体。例如,一座山,一个池塘,一座城市。An entity. For example, a mountain, a pond, a city.

  • 一个空间。例如,市区,热带地区。A space. For example, town district, the tropics.

  • 一个可定义的位置。例如,一个十字路口,作为两条街道交汇的特定地点。A definable location. For example, a crossroad, as a particular place where two streets intersect.

一些文档使用术语地理空间特征来指代地理特征。Some documents use the term geospatial feature to refer to geographic features.

几何是另一个表示地理特征的词。最初,几何这个词的意思是对地球的测量。另一个含义来自制图学,指制图师用于绘制世界地图的几何特征。Geometry is another word that denotes a geographic feature. Originally the word geometry meant measurement of the earth. Another meaning comes from cartography, referring to the geometric features that cartographers use to map the world.

这里的讨论认为这些术语是同义的:地理特征、地理空间特征、特征或几何。最常用的术语是几何,定义为表示世界上任何具有位置的事物的一个点或一个点的集合。The discussion here considers these terms synonymous: geographic feature, geospatial feature, feature, or geometry. The term most commonly used is geometry, defined as a point or an aggregate of points representing anything in the world that has a location.

以下内容涵盖这些主题:The following material covers these topics:

  • MySQL 模型中实现的空间数据类型The spatial data types implemented in MySQL model

  • OpenGIS 几何模型中空间扩展的基础The basis of the spatial extensions in the OpenGIS geometry model

  • 表示空间数据的数据格式Data formats for representing spatial data

  • 如何在 MySQL 中使用空间数据How to use spatial data in MySQL

  • 空间数据索引的使用Use of indexing for spatial data

  • MySQL 与 OpenGIS 规范的差异MySQL differences from the OpenGIS specification

有关处理空间数据的函数的信息,请参见 第 14.16 节,“空间分析函数”。For information about functions that operate on spatial data, see Section 14.16, “Spatial Analysis Functions”.

附加资源Additional Resources

这些标准对于 MySQL 实现空间操作非常重要:These standards are important for the MySQL implementation of spatial operations:

如果您对 MySQL 空间扩展的使用有疑问或关注,可以在 GIS 论坛上讨论:https://forums.mysql.com/list.php?23。If you have questions or concerns about the use of the spatial extensions to MySQL, you can discuss them in the GIS forum: https://forums.mysql.com/list.php?23.