11.4.5 Spatial Reference System Support空间参考系统支持

A spatial reference system (SRS) for spatial data is a coordinate-based system for geographic locations.用于空间数据的空间参考系统(SRS)是用于地理位置的基于坐标的系统。

There are different types of spatial reference systems:有不同类型的空间参考系:

MySQL maintains information about available spatial reference systems for spatial data in the data dictionary mysql.st_spatial_reference_systems table, which can store entries for projected and geographic SRSs. MySQL在数据字典mysqlst_spatial_reference_systems表中维护空间数据的可用空间参考系统信息,该表可以存储投影和地理SRS的条目。This data dictionary table is invisible, but SRS entry contents are available through the INFORMATION_SCHEMA ST_SPATIAL_REFERENCE_SYSTEMS table, implemented as a view on mysql.st_spatial_reference_systems (see Section 26.3.36, “The INFORMATION_SCHEMA ST_SPATIAL_REFERENCE_SYSTEMS Table”).此数据字典表是不可见的,但SRS条目内容可通过INFORMATION_SCHEMA ST_SPATIAL_REFERENCE_SYSTEMS表获得,该表作为mysql.st_spatial_reference_systems上的视图实现(请参阅第26.3.36节,“INFORMATION_SCHEMA ST _SPATIAL_REFERENCE_StYSTEMS表”)。

The following example shows what an SRS entry looks like:以下示例显示SRS条目的外观:

mysql> SELECT *
FROM INFORMATION_SCHEMA.ST_SPATIAL_REFERENCE_SYSTEMS
WHERE SRS_ID = 4326\G
*************************** 1. row ***************************
                SRS_NAME: WGS 84
                  SRS_ID: 4326
            ORGANIZATION: EPSG
ORGANIZATION_COORDSYS_ID: 4326
              DEFINITION: GEOGCS["WGS 84",DATUM["World Geodetic System 1984",
                          SPHEROID["WGS 84",6378137,298.257223563,
                          AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],
                          PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],
                          UNIT["degree",0.017453292519943278,
                          AUTHORITY["EPSG","9122"]],
                          AXIS["Lat",NORTH],AXIS["Long",EAST],
                          AUTHORITY["EPSG","4326"]]
             DESCRIPTION:

This entry describes the SRS used for GPS systems. It has a name (SRS_NAME) of WGS 84 and an ID (SRS_ID) of 4326, which is the ID used by the European Petroleum Survey Group (EPSG).本条目介绍用于GPS系统的SRS。它的名称(SRS_NAME)为WGS 84,ID(SRS_ID)为4326,这是欧洲石油调查集团(EPSG)使用的ID。

SRS definitions in the DEFINITION column are WKT values, represented as specified in the Open Geospatial Consortium document OGC 12-063r5.DEFINITION列中的SRS定义是WKT值,如开放地理空间联盟文件OGC 12-063r5中所规定。

SRS_ID values represent the same kind of values as the SRID of geometry values or passed as the SRID argument to spatial functions. SRID 0 (the unitless Cartesian plane) is special. 值表示与几何体值的SRID相同类型的值,或作为SRID参数传递给空间函数。SRID 0(无单位笛卡尔平面)是特殊的。It is always a legal spatial reference system ID and can be used in any computations on spatial data that depend on SRID values.它始终是一个合法的空间参考系统ID,可以用于任何依赖于SRID值的空间数据计算。

For computations on multiple geometry values, all values must have the same SRID or an error occurs.对于多个几何体值的计算,所有值必须具有相同的SRID,否则将发生错误。

SRS definition parsing occurs on demand when definitions are needed by GIS functions. Parsed definitions are stored in the data dictionary cache to enable reuse and avoid incurring parsing overhead for every statement that needs SRS information.当GIS功能需要定义时,SRS定义解析会按需进行。解析后的定义存储在数据字典缓存中,以实现重用,并避免为每个需要SRS信息的语句带来解析开销。

To enable manipulation of SRS entries stored in the data dictionary, MySQL provides these SQL statements:为了能够操作存储在数据字典中的SRS条目,MySQL提供了以下SQL语句: