Fork me on GitHub

ST_SetSRID

Signatures

GEOMETRY ST_SetSRID(GEOMETRY geom, INT srid);

Description

Returns a copy of geom with spatial reference id set to srid.

ST_SetSRID does not to actually change the SRID of geom. For this purpose, use ST_Transform.
Implements the OpenGIS Simple Features Implementation Specification for SQL version 1.2.1.

Examples

CREATE TABLE test_srid(the_geom GEOMETRY);
INSERT INTO test_srid VALUES (
    ST_GeomFromText('POINT(15 25)', 27572));
SELECT ST_SRID(ST_SETSRID(the_geom, 5321)) trans,
    ST_SRID(the_geom) original FROM test_srid;
-- Answer:
--    | TRANS | ORIGINAL |
--    |-------|----------|
--    |  5321 |  27572   |
See also