ArcGIS Server Banner

ST_Transform

ST_Transform

Release 9.3 E-mail This TopicPrintable VersionGive Us feedback

Definition

ST_Transform transforms the ST_Geometry into the spatial reference specified by the spatial reference ID (SRID).

NOTE: The source and destination spatial references must have the same geographic datum.

Syntax

Oracle

sde.st_transform (g1 sde.st_geometry, srid integer)

PostgreSQL

st_transform (g1 st_geometry, srid integer)

Return type

ST_Geometry

Example

The following CREATE TABLE statement creates the transform_test table, which has two ST_LineString columns, ln1 and ln2.

CREATE TABLE transform_test (ln1 sde.st_linestring, ln2 sde.st_geometry);

The following INSERT statement inserts an ST_LineString into ln1 with an SRID of 102.

INSERT INTO transform_test VALUES (
sde.st_linefromtext ('linestring (10.01 40.03, 92.32 29.39)', 102)
);

The ST_Transform function converts the ST_LineString of ln1 from the coordinate reference assigned to SRID 102 to the coordinate reference assigned to SRID 105. The following UPDATE statement stores the transformed ST_LineString in column ln2.

UPDATE transform_test
SET ln2 = sde.st_transform (ln1, 105);

NOTE: SRIDs 102 and 105 have to exist in the ST_SPATIAL_REFERENCES view, and both must have the same geographic datum.

See Also

  • An overview of SQL functions used with ST_Geometry types