Examples: ST_Transform - Advanced SQL Engine - Teradata Database

Geospatial Data Types

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
vci1556127188517.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1181
lifecycle
previous
Product Category
Teradata Vantage™
   SELECT R.skey, R.shape.ST_Transform(X.srtext, Y.srtext)
   FROM sample_shapes R ,
        SYSSPATIAL.SPATIAL_REF_SYS X ,
        SYSSPATIAL.SPATIAL_REF_SYS Y
   WHERE  X.AUTH_SRID = 4326 and Y.AUTH_SRID = 3149;

The following example demonstrates the use of the toSRSid argument.

CREATE TABLE customers(pkey INTEGER, point ST_Geometry);
INSERT INTO customers VALUES(0, new ST_Geometry('POINT(-89.39 43.09)', 1619));
INSERT INTO customers VALUES(1, new ST_Geometry('POINT(-87.65 41.90)', 1619));

CREATE TABLE transformed_customers2(pkey INTEGER, point ST_Geometry);
INSERT INTO transformed_customers2
SELECT pkey,
       point.ST_Transform(3054, X.srtext, Y.srtext)
FROM customers,
     SYSSPATIAL.SPATIAL_REF_SYS X,
     SYSSPATIAL.SPATIAL_REF_SYS Y
WHERE X.AUTH_SRID = 32616 AND    -- UTM 16 / WGS84
      Y.AUTH_SRID = 4326         -- WGS84

;
;SELECT pkey,
       point.ST_SRID(),
       point
FROM transformed_customers2
ORDER BY pkey;

       pkey point.ST_SRID() point
----------- --------------- ------------------------------------------------
          0            3054 POINT (305475.753263251972385 4773581.672131018)
          1            3054 POINT (446084.218845848692581 4638877.682686116)