Skip to main content

Spatial reference systems

A spatial reference system (SRS) for spatial data is a coordinate-based system for defining geographic locations. The current version of seekdb only supports the default SRS provided by the system.

Spatial reference systems generally include the following types:

  • Projected SRS: A projected SRS is a projection of the Earth onto a plane, essentially a flat map. The coordinate system on this plane is a Cartesian coordinate system that uses units of length (meters, feet, etc.) rather than longitude and latitude.

  • Geographic SRS. A geographic SRS is a non-projected SRS that represents longitude-latitude (or latitude-longitude) coordinates on an ellipsoid, expressed in angular units.

Additionally, there is an infinitely flat Cartesian plane represented by SRID 0, whose axes have no assigned units. Unlike a projected SRS, it is an abstract plane with no geographic reference and does not necessarily represent the Earth. SRID 0 is the default SRID for spatial data.

SRS content can be obtained through the INFORMATION_SCHEMA ST_SPATIAL_REFERENCE_SYSTEMS table, as shown in the following example:

obclient> 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["Lon",EAST],AUTHORITY["EPSG","4326"]]
DESCRIPTION: NULL
1 row in set

The above example describes the SRS used by GPS systems, with the name (SRS_NAME) WGS 84 and ID (SRS_ID) 4326.

The SRS definition in the DEFINITION column is a WKT value. WKT is defined based on Extended Backus Naur Form (EBNF). WKT can be used both as a data format (referred to as WKT-Data in this document) and for SRS definitions in GIS.

The SRS_ID value represents the same type of value as the SRID of a geometry value, or is passed as an SRID parameter to spatial functions. SRID 0 (unitless Cartesian plane) is a special, valid spatial reference system ID that can be used for any spatial data calculations that depend on SRID values.

For calculations involving multiple geometry values, all values must have the same SRID; otherwise, an error will occur.