Name

ST_SetSRID — Sets the Spatial Reference ID for a geometry,

Synopsis

geometry ST_SetSRID(bytea Geometry, integer SRID);

Alias

SetSRID

Description

Sets the Spatial Reference ID for a geometry,

[Caution]

This function does not transform the geometry in any way.

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
----

Examples

SELECT ST_AsEWKT(ST_SetSRID(ST_GeomFromEWKT('POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))'),25830));
--Result
SRID=25830;POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))

SELECT ST_SRID(geomA) as origSRID,ST_SRID(ST_SetSRID(geomA,25830)) as newSRID 
from (SELECT ST_GeomFromEWKT('POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))') as geomA) as foo; 

 origsrid | newsrid
----------+---------
       -1 |   25830
(1 row)

Related functions

ST_SRID, ST_Transform