17.10 - 例: 地理空間データのWKT形式 - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - 地理空間データ型

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
2021年7月
Content Type
プログラミング リファレンス
Publication ID
B035-1181-171K-JPN
Language
日本語 (日本)

次のテーブルについて考察します。

   CREATE TABLE sample_shapes (skey INTEGER, shape ST_Geometry);

次に、WKT表現を使用したジオメトリ値の挿入方法について、いくつかの例を示します。

   INSERT INTO sample_shapes
      VALUES (1001, 'POINT(10 20)');

   INSERT INTO sample_shapes
      VALUES (1002, 'POINT EMPTY');

   INSERT INTO sample_shapes
      VALUES (1003, 'LINESTRING(1 1, 2 2, 3 3, 4 4)');

   INSERT INTO sample_shapes
      VALUES (1004, 'LINESTRING EMPTY');

   INSERT INTO sample_shapes
      VALUES (1005, 'POLYGON((0 0, 0 20, 20 20, 20 0, 0 0),
                             (5 5, 5 10, 10 10, 10 5, 5 5))');

   INSERT INTO sample_shapes
      VALUES (1006, 'MULTIPOINT((1 1), (1 3), (6 3), (10 5), (20 1))');

   INSERT INTO sample_shapes
      VALUES (1007, 'MULTILINESTRING((1 1, 1 3, 6 3),
                                     (10 5, 20 1))');

   INSERT INTO sample_shapes
      VALUES (1008, 'MULTIPOLYGON(((1 1, 1 3, 6 3, 6 0, 1 1)),
                                  ((10 5, 10 10, 20 10, 20 5, 10 5)))');

   INSERT INTO sample_shapes
      VALUES (1009, 'GEOMETRYCOLLECTION( POINT(10 10),
                                         POINT(30 30),
                                         LINESTRING(15 15, 20 20))');

   INSERT INTO sample_shapes
      VALUES (1010, 'GEOSEQUENCE( (10 20, 30 40, 50 60),
                                  (2007-08-22 12:05:23.56,
                                   2007-08-22 12:08:25.14,
                                   2007-08-22 12:11:41.52),
                                  (1, 2, 3),
                                  (2, 10, 12, 11, 18, 21, 19) )' );

   INSERT INTO sample_shapes
      VALUES (1011, 'GEOSEQUENCE( (10 20, 30 40, 50 60),
                                  (2008-03-17 10:34:03.53,
                                   2008-03-17 10:38:25.21,
                                   2008-03-17 10:41:41.48),
                                  (1, 2, 3),
                                  (0))');

SELECT * FROM sample_shapes ORDER BY skey;