ST_Transform function
The ST_Transform function takes a geometry and a spatial reference system identifier as input parameters and transforms the geometry to be represented in the specified spatial reference system. Projections and conversions between different coordinate systems are performed and the coordinates of the geometries are adjusted accordingly.
The geometry can be converted to the specified spatial reference system only if the region covered by the specified spatial reference system covers the location of the geometry. If either the geometry's current spatial reference system or the specified spatial reference system is based on a projected coordinate system, a reverse projection is performed to determine the geographic coordinate system that underlies the projected one.
Syntax
Parameters
- geometry
- A value of type ST_Geometry or one of its subtypes that represents the geometry that is transformed to the spatial reference system identified by srs_id.
- srs_id
- A value of type INTEGER that identifies the spatial reference
system for the resulting geometry.
If the transformation to the specified spatial reference system cannot be performed because the current spatial reference system of geometry is not compatible with the spatial reference system identified by srs_id, then an exception condition is raised (SQLSTATE 38SUC).
If srs_id does not identify a spatial reference system listed in the catalog view SYSGEO.ST_SPATIAL_REFERENCE_SYSTEMS, then an exception condition is raised (SQLSTATE 38SU1).
Return type
ST_Geometry