16.20 - 例: ST_Transform - Teradata Vantage NewSQL Engine

Teradata Vantage™ 地理空間データ型

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
プログラミング リファレンス
featnum
B035-1181-162K-JPN
   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;

次に、toSRSid引数の使用例を示します。

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)