ST_Transform assigns a geometry to a spatial reference system other than the spatial reference system to which the geometry is currently assigned.
Syntax
db2gse.ST_Transform(g db2gse.ST_Geometry, cr db2gse.coordref)
Return type
db2gse.ST_Geometry
Examples
The following CREATE TABLE statement creates the TRANSFORM_TEST table, which has two linestring columns, L1 and L2.
CREATE TABLE TRANSFORM_TEST (tid integer, l1 db2gse.ST_LineString, l2 db2gse.ST_LineString)
The following INSERT statement inserts a linestring into l1 with an SRID of 102.
INSERT INTO TRANSFORM_TEST VALUES (1, db2gse.ST_LineFromText('linestring(10.01 40.43, 92.32 29.89)', db2gse.coordref()..srid(102)),NULL)
The ST_Transform function converts the linestring of L1 from the coordinate reference assigned to SRID 102 to the coordinate reference assigned to SRID 105. The following UPDATE statement stores the transformed linestring in column l2.
UPDATE TRANSFORM_TEST SET l2 = db2gse.ST_Transform(l1, db2gse.coordref()..srid(105))