- 13.4.1 空间数据类型13.4.1 Spatial Data Types
- 13.4.2 OpenGIS 几何模型13.4.2 The OpenGIS Geometry Model
- 13.4.3 支持的空间数据格式13.4.3 Supported Spatial Data Formats
- 13.4.4 几何的良构性和有效性13.4.4 Geometry Well-Formedness and Validity
- 13.4.5 空间参考系统支持13.4.5 Spatial Reference System Support
- 13.4.6 创建空间列13.4.6 Creating Spatial Columns
- 13.4.7 填充空间列13.4.7 Populating Spatial Columns
- 13.4.8 获取空间数据13.4.8 Fetching Spatial Data
- 13.4.9 优化空间分析13.4.9 Optimizing Spatial Analysis
- 13.4.10 创建空间索引13.4.10 Creating Spatial Indexes
- 13.4.11 使用空间索引13.4.11 Using Spatial Indexes
开放地理空间联盟(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:
SQL/MM 第 3 部分:空间。SQL/MM Part 3: Spatial.
开放地理空间联盟发布了地理信息 OpenGIS®实施标准,该文档提出了几种将 SQL 关系数据库管理系统扩展以支持空间数据的概念方法。特别可参考《简单要素访问 - 第 1 部分:通用架构》和《简单要素访问 - 第 2 部分:SQL 选项》。开放地理空间联盟(OGC)在http://www.opengeospatial.org/上维护一个网站。该规范可在http://www.opengeospatial.org/standards/sfs获得。它包含与此处材料相关的其他信息。The Open Geospatial Consortium publishes the OpenGIS® Implementation Standard for Geographic information, a document that proposes several conceptual ways for extending an SQL RDBMS to support spatial data. See in particular Simple Feature Access - Part 1: Common Architecture, and Simple Feature Access - Part 2: SQL Option. The Open Geospatial Consortium (OGC) maintains a website at http://www.opengeospatial.org/. The specification is available there at http://www.opengeospatial.org/standards/sfs. It contains additional information relevant to the material here.
的语法空间参考系统(SRS) 定义基于OpenGIS 实施规范:坐标转换服务,版本 1.00,OGC 01-009,2001 年 1 月 12 日,第 7.2 节。该规范可在http://www.opengeospatial.org/standards/ct获取。有关 MySQL 实现的 SRS 定义与该规范的差异,请参见第 15.1.19 节,“CREATE SPATIAL REFERENCE SYSTEM 语句”.The grammar for spatial reference system (SRS) definitions is based on the grammar defined in OpenGIS Implementation Specification: Coordinate Transformation Services, Revision 1.00, OGC 01-009, January 12, 2001, Section 7.2. This specification is available at http://www.opengeospatial.org/standards/ct. For differences from that specification in SRS definitions as implemented in MySQL, see Section 15.1.19, “CREATE SPATIAL REFERENCE SYSTEM Statement”.
如果您对 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.