top of page



ST_SRID(g[, srid])

With a single argument representing a valid geometry object g,
ST_SRID() returns an integer indicating the ID of the spatial reference
system (SRS) associated with g.

With the optional second argument representing a valid SRID value,
ST_SRID() returns an object with the same type as its first argument
with an SRID value equal to the second argument. This only sets the
SRID value of the object; it does not perform any transformation of
coordinate values.

ST_SRID() handles its arguments as described in the introduction to
this section, with this exception:

o For the single-argument syntax, ST_SRID() returns the geometry SRID
even if it refers to an undefined SRS. An ER_SRS_NOT_FOUND
.html#error_er_srs_not_found) error does not occur.

ST_SRID(g, target_srid) and ST_Transform(g, target_srid) differ as

o ST_SRID() changes the geometry SRID value without transforming its

o ST_Transform() transforms the geometry coordinates in addition to
changing its SRID value.



mysql> SET @g = ST_GeomFromText('LineString(1 1,2 2)', 0);
mysql> SELECT ST_SRID(@g);
| ST_SRID(@g) |
| 0 |
mysql> SET @g = ST_SRID(@g, 4326);
mysql> SELECT ST_SRID(@g);
| ST_SRID(@g) |
| 4326 |

bottom of page