ST_SRID()

TL;DR

Use ST_SRID() to read the SRID metadata carried by a geometry value.

Returns the spatial reference identifier (SRID) of a geometry value.

Syntax

ST_SRID(geom)

Arguments

Argument

Description

geom

A GEOMETRY or GEOMETRY32 value.

Return Value

Returns the SRID as UINT32.

Usage Notes

  • A geometry constructed without an SRID has SRID 0.

  • SRID is carried in the geometry expression or column type, rather than its WKB payload; it propagates through tested derived functions.

Examples

DROP DATABASE IF EXISTS geo_srid_demo;
CREATE DATABASE geo_srid_demo;
USE geo_srid_demo;

SELECT ST_SRID(ST_GeomFromText('POINT(1 2)', 4326)) AS srid;

DROP DATABASE geo_srid_demo;

See Also