Examples: AggGeomIntersection - Analytics Database - Teradata Vantage

Geospatial Data Types

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2023-08-30
dita:mapPath
qgk1628112272483.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
ghz1472251264557
lifecycle
latest
Product Category
Teradata Vantageā„¢

These examples use the AggGeomIntersection function to get the spatial intersection of the shape column values in rows of the sample_shapes table:

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 AggGeomIntersection(shape) from sample_shapes;

Output:

AggGeomIntersection(shape)
---------------------------------------------------------------
GEOMETRYCOLLECTION EMPTY
select AggGeomIntersection(shape) from sample_shapes where skey in (1001, 1002);

Output:

AggGeomIntersection(shape)
---------------------------------------------------------------
POINT (10 20 30)
select AggGeomIntersection(shape) from sample_shapes where skey in (1003, 1004);

Output:

AggGeomIntersection(shape)
---------------------------------------------------------------
LINESTRING (100 500 500,500 100 500)
select AggGeomIntersection(shape) from sample_shapes where skey in (1003,1005);

Output:

AggGeomIntersection(shape)
---------------------------------------------------------------
POINT (500 500 500)
select AggGeomIntersection(shape) from sample_shapes where skey in (1006,1007);

Output:

AggGeomIntersection(shape)
---------------------------------------------------------------
POINT (50 50 50)