ST_SetSRID — Sets the Spatial Reference ID for a geometry,
geometry ST_SetSRID(
bytea
Geometry, integer
SRID)
;
Sets the Spatial Reference ID for a geometry,
This function does not transform the geometry in any way. |
2D | 3D | M |
---|---|---|
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 |
---|---|---|---|
- | - | - | - |
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)