Name

ST_Transform — Returns a Geometry transformed to the specified spatial reference system.

Synopsis

varchar ST_Transform(bytea Geometry, integer SRID);

Alias

Transform

Description

Returns a Geometry transformed to the specified spatial reference system (SRID). This SRID must exist in the SPATIAL_REF_SYS table. The transformation is done through GeoTools library.

ST_Transform actually reprojects and thus changes the coordinates of a geometry from one spatial reference system to another, while ST_SetSRID simply changes the SRID of the geometry

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
---5.1.6

Examples

--Transform from ETRS89 UTM H30 to WGS84 long-lat
SELECT ST_AsText(ST_Transform(ST_GeomFromText('POINT(729006.2060 4373499.8410 27.7760)',25830),4326));

--Result
POINT (-0.3374115022027405 39.48063411917513 27.776)

Related functions

ST_SRID, ST_SetSRID