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:有不同类型的空间参考系:
A projected SRS is a projection of a globe onto a flat surface; that is, a flat map. 投影SRS是地球仪在平面上的投影;即平面地图。For example, a light bulb inside a globe that shines on a paper cylinder surrounding the globe projects a map onto the paper. The result is georeferenced: Each point maps to a place on the globe. 例如,地球仪内的灯泡照射在地球仪周围的圆柱体上,将地图投影到纸上。结果是地理参考的:每个点都映射到地球上的一个地方。The coordinate system on that plane is Cartesian using a length unit (meters, feet, and so forth), rather than degrees of longitude and latitude.该平面上的坐标系是笛卡尔坐标系,使用的是长度单位(米、英尺等),而不是经纬度。
The globes in this case are ellipsoids; that is, flattened spheres. Earth is a bit shorter in its North-South axis than its East-West axis, so a slightly flattened sphere is more correct, but perfect spheres permit faster calculations.这种情况下的球体是椭球体;即扁平球体。地球的南北轴比东西轴短一点,所以稍微变平的球体更正确,但完美的球体可以更快地进行计算。
A geographic SRS is a nonprojected SRS representing longitude-latitude (or latitude-longitude) coordinates on an ellipsoid, in any angular unit.地理SRS是一种非投影SRS,以任何角度单位表示椭球体上的经纬度(或经纬度)坐标。
The SRS denoted in MySQL by SRID 0 represents an infinite flat Cartesian plane with no units assigned to its axes. MySQL中SRID 0表示的SRS表示一个无限平坦的笛卡尔平面,没有为其轴分配单位。Unlike projected SRSs, it is not georeferenced and it does not necessarily represent Earth. It is an abstract plane that can be used for anything. SRID 0 is the default SRID for spatial data in MySQL.与投影的SRS不同,它没有地理参考,也不一定代表地球。它是一个抽象的平面,可以用于任何事情。SRID 0是MySQL中空间数据的默认SRID。
MySQL maintains information about available spatial reference systems for spatial data in the data dictionary MySQL在数据字典mysql.st_spatial_reference_systems
table, which can store entries for projected and geographic SRSs. mysqlst_spatial_reference_systems
表中维护空间数据的可用空间参考系统信息,该表可以存储投影和地理SRS的条目。This data dictionary table is invisible, but SRS entry contents are available through the 此数据字典表是不可见的,但SRS条目内容可通过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”).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 (本条目介绍用于GPS系统的SRS。它的名称(SRS_NAME
) of WGS 84 and an ID (SRS_ID
) of 4326, which is the ID used by the European Petroleum Survey Group (EPSG).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语句:
CREATE SPATIAL REFERENCE SYSTEM
: See Section 13.1.19, “CREATE SPATIAL REFERENCE SYSTEM Statement”. The description for this statement includes additional information about SRS components.:参见第13.1.19节,“创建空间参考系统声明”。此语句的描述包括有关SRS组件的附加信息。
DROP SPATIAL REFERENCE SYSTEM
: See Section 13.1.31, “DROP SPATIAL REFERENCE SYSTEM Statement”.:参见第13.1.31节,“DROP SPATIAL REFERENCE SYSTEM语句”。