例: AggGeomUnion - Advanced SQL Engine - Teradata Database

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

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
2021年7月
Language
日本語
Last Update
2021-09-23
dita:mapPath
ja-JP/ufo1590694251930.ditamap
dita:ditavalPath
ja-JP/wrg1590696035526.ditaval
dita:id
B035-1181
Product Category
Software
Teradata Vantage

この例では、AggGeomUnion関数を使用して、sample_shapesテーブルの行にあるshape列の和空間を取得します。

CREATE TABLE sample_shapes(skey INTEGER, shape ST_Geometry);

INSERT INTO sample_shapes(1001,'MultiPoint((10 20 30),(40 50 60))');
INSERT INTO sample_shapes(1002,'Point(10 20 30)');
INSERT INTO sample_shapes(1003, 
 'Polygon((100 100 100, 100 500 500, 500 500 500, 500 100 500, 100 100 100))');
INSERT INTO sample_shapes(1004, 'Linestring (100 500 500, 500 100 500)');
INSERT INTO sample_shapes(1005, 
 'Polygon((500 500 500, 500 1000 1000, 1000 1000 1000, 1000 500 1000, 500 500 500))');
INSERT INTO sample_shapes(1006, 'Polygon((0 0 0, 0 50 50, 50 50 50, 50 0 50, 0 0 0))');
INSERT INTO sample_shapes(1007, 
'Polygon((50 50 50, 50 100 100, 100 100 100, 100 50 100, 50 50 50))');

select AggGeomUnion(shape) from sample_shapes where skey in (1001, 1002);

AggGeomUnion(shape)
---------------------------------------------------------------------------------
MULTIPOINT (10 20 30,40 50 60)

select AggGeomUnion(shape) from sample_shapes where skey in (1003, 1004);

AggGeomUnion(shape)
---------------------------------------------------------------------------------
POLYGON ((100 100 100,100 500 500,500 500 500,500 100 500,100 100 100))

select AggGeomUnion(shape) from sample_shapes where skey in (1003,1005,1006,1007);

AggGeomUnion(shape)
---------------------------------------------------------------------------------
MULTIPOLYGON (((50 50 50,50 100 100,100 100 100,100 50 100,50 50 50)),
((500 500 500,500 1000 1000,1000 1000 1000,1000 500 1000,500 500 500)),
((0 0 0,0 50 50,50 50 50,50 0 50,0 0 0)),
((100 100 100,100 500 500,500 500 500,500 100 500,100 100 100)))