Categories:

Geospatial functions

ST_SRID¶

Returns the SRID (spatial reference system identifier) of a GEOGRAPHY or GEOMETRY object.

Currently, for any value of the GEOGRAPHY type, only SRID 4326 is supported and is returned.

Syntax¶

ST_SRID( <geography_or_geometry_expression> )
Copy

Arguments¶

geography_or_geometry_expression

The argument must be an expression of type GEOGRAPHY or GEOMETRY.

Returns¶

Returns a value of type NUMBER(4,0).

Usage notes¶

  • Returns NULL if the input is NULL.

Examples¶

GEOGRAPHY examples¶

This shows a simple use of the ST_SRID function:

SELECT ST_SRID(ST_MAKEPOINT(37.5, 45.5));
+-----------------------------------+
| ST_SRID(ST_MAKEPOINT(37.5, 45.5)) |
|-----------------------------------|
|                              4326 |
+-----------------------------------+
Copy

This shows use of the ST_SRID function with NULL values:

SELECT ST_SRID(ST_MAKEPOINT(NULL, NULL)), ST_SRID(NULL);
+-----------------------------------+---------------+
| ST_SRID(ST_MAKEPOINT(NULL, NULL)) | ST_SRID(NULL) |
|-----------------------------------+---------------|
|                              NULL |          NULL |
+-----------------------------------+---------------+
Copy