MySQL 5.7-11.4 Spatial Data Types

11.4.1 Spatial Data Types

11.4.2 The OpenGIS Geometry Model

11.4.3 Supported Spatial Data Formats

11.4.4 Geometry Well-Formedness and Validity

11.4.5 Creating Spatial Columns

11.4.6 Populating Spatial Columns

11.4.7 Fetching Spatial Data

11.4.8 Optimizing Spatial Analysis

11.4.9 Creating Spatial Indexes

11.4.10 Using Spatial Indexes

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)是一个由250多家公司、机构和大学组成的国际联盟,参与开发可用于管理空间数据的各种应用程序的公开概念解决方案。

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 Simple Feature Access - Part 2: SQL Option | OGC.

开放地理空间联盟发布了地理信息OpenGIS®实现标准-简单特性访问-第2部分:SQL选项,该文档提出了几种扩展SQL RDBMS以支持空间数据的概念性方法。该规范可从OGC网站的简单功能访问-第2部分:SQL选项| OGC获得。

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.

遵循OGC规范,MySQL将空间扩展作为SQL的一个子集,并使用Geometry Types环境。这个术语指的是使用一组几何类型进行扩展的SQL环境。几何值SQL列实现为具有几何类型的列。该规范描述了一组SQL几何类型,以及用于创建和分析几何值的这些类型的函数。

MySQL spatial extensions enable the generation, storage, and analysis of geographic features:

MySQL空间扩展支持地理特征的生成、存储和分析:

  • Data types for representing spatial values

  • 表示空间值的数据类型

  • Functions for manipulating spatial values

  • 用于操作空间值的函数

  • Spatial indexing for improved access times to spatial columns

  • 空间索引以提高对空间列的访问时间

The spatial data types and functions are available for MyISAMInnoDBNDB, 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 13.1.14, “CREATE INDEX Statement”.

空间数据类型和函数适用于MyISAM、InnoDB、NDB和ARCHIVE表。对于索引空间列,MyISAM和InnoDB同时支持空间索引和非空间索引。其他存储引擎支持非spatial索引,如13.1.14节“CREATE INDEX Statement”所述。

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 featuregeospatial featurefeature, 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:

以下材料涵盖了这些主题:

  • The spatial data types implemented in MySQL model

  • MySQL模型中实现的空间数据类型

  • The basis of the spatial extensions in the OpenGIS geometry model

  • OpenGIS几何模型空间扩展的基础

  • Data formats for representing spatial data

  • 表示空间数据的数据格式

  • How to use spatial data in MySQL

  • 如何在MySQL中使用空间数据

  • Use of indexing for spatial data

  • 空间数据索引的使用

  • MySQL differences from the OpenGIS specification

  • MySQL与OpenGIS规范的区别

For information about functions that operate on spatial data, see Section 12.17, “Spatial Analysis Functions”.

有关操作空间数据的函数的信息

MySQL GIS Conformance and Compatibility

MySQL GIS一致性和兼容性

MySQL does not implement the following GIS features:

MySQL没有实现以下GIS特性:

  • Additional Metadata Views额外的元数据视图

    OpenGIS specifications propose several additional metadata views. For example, a system view named GEOMETRY_COLUMNS contains a description of geometry columns, one row for each geometry column in the database. OpenGIS规范提出了几个额外的元数据视图。例如,名为GEOMETRY_COLUMNS的系统视图包含几何列的描述,数据库中的每个几何列对应一行。

  • The OpenGIS function Length() on LineString and MultiLineString should be called in MySQL as ST_Length() 在MySQL中,LineString和MultiLineString的OpenGIS函数Length()应该被调用为ST_Length()

    The problem is that there is an existing SQL function Length() that calculates the length of string values, and sometimes it is not possible to distinguish whether the function is called in a textual or spatial context. 问题在于,已有一个SQL函数Length()用于计算字符串值的长度,有时无法区分函数是在文本上下文中调用的还是在空间上下文中调用的。

Additional Resources

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. The Open Geospatial Consortium (OGC) maintains a website at The Home of Location Technology Innovation and Collaboration | OGC. The specification is available there at Simple Feature Access - Part 2: SQL Option | OGC. It contains additional information relevant to the material here.

开放地理空间联盟发布了地理信息OpenGIS®实现标准-简单特性访问-第2部分:SQL选项,该文档提出了几种扩展SQL RDBMS以支持空间数据的概念性方法。开放地理空间联盟(OGC)在定位技术创新和协作之家| OGC维持着一个网站。该规范可以在简单特性访问-第2部分:SQL Option | OGC中获得。它包含了与这里的材料相关的附加信息。

If you have questions or concerns about the use of the spatial extensions to MySQL, you can discuss them in the GIS forum: MySQL :: MySQL Forums :: GIS.

如果你对MySQL空间扩展的使用有疑问或担忧,你可以在GIS论坛上讨论:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值