Categories:

Geospatial Functions

ST_SRID

Returns the SRID (spatial reference system identifier) of a GEOGRAPHY value. Currently, only SRID 4326 is supported and will be returned for any value of type GEOGRAPHY.

Syntax

ST_SRID( <geography_expression> )

Arguments

geography_expression

The argument must be an expression of type GEOGRAPHY.

Returns

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

Usage Notes

  • Returns NULL if the input is NULL.

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 |
+-----------------------------------+

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 |
+-----------------------------------+---------------+