PointInPolygon Example 2: OutputAll ('false') - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.00
1.0
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantage™

Input

As in PointInPolygon Example 1: OutputAll ('true'):
  • source: source_passenger
  • reference: reference_terminal

SQL Call

SELECT * FROM PointInPolygon (
  ON source_passenger AS source PARTITION BY ANY
  ON reference_terminal AS reference DIMENSION
  USING
  SourceLocationColumn ('source_location_point')
  ReferenceLocationColumn ('reference_location_polygon')
  ReferenceNameColumns ('terminal_name')
  outputall ('false')
  Accumulate ('customer_id', 'customer_name')
) AS dt ORDER BY source_location_point;

Output

The output table includes only passengers inside a terminal. Macy is not in any terminal and does not appear in the output table.

source_location_point ref_reference_location_polygon ref_terminal_name pip_flag customer_id customer_name
POINT (30 10) POLYGON ((0 0, 100 0, 100 100, 0 100, 0 0)) Terminal A 1 1 Jeff
POINT (300 10) POLYGON ((200 0, 400 0, 400 200, 200 200, 200 0)) Terminal B 1 2 John
POINT (300 20) POLYGON ((200 0, 400 0, 400 200, 200 200, 200 0)) Terminal B 1 3 Maria