ST_SRID
Identifies the spatial reference system identifier (SRID) stored with a spatial object.
The SRID of a GEOMETRY object can only be determined when passing an SRID to either ST_GeomFromText or ST_GeomFromWKB. ST_SRID returns this stored value. SRID values of 0 to 232-1 are valid.
Behavior Type
Syntax
ST_SRID( g )
Arguments
g |
Spatial object for which you want the SRID, type GEOMETRY or GEOGRAPHY |
Returns
INTEGER
Supported Data Types
Data Type | GEOMETRY | GEOGRAPHY (Perfect Sphere) | GEOGRAPHY (WGS84) |
Point | Yes | Yes | Yes |
Multipoint | Yes | Yes | Yes |
Linestring | Yes | Yes | Yes |
Multilinestring | Yes | Yes | Yes |
Polygon | Yes | Yes | Yes |
Multipolygon | Yes | Yes | Yes |
GeometryCollection | Yes | No | No |
Examples
The following examples show how to use ST_SRID.
The default SRID of a GEOMETRY object is 0:
=> SELECT ST_SRID(ST_GeomFromText( 'POLYGON((-1 -1,2 2,0 1,-1 -1))')); ST_SRID --------- 0 (1 row)
The default SRID of a GEOGRAPHY object is 4326:
=> SELECT ST_SRID(ST_GeographyFromText( 'POLYGON((22 35,24 35,26 32,22 35))')); ST_SRID --------- 4326 (1 row)