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

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.10
1.1
Published
October 2019
Language
English (United States)
Last Update
2019-12-31
dita:mapPath
ima1540829771750.ditamap
dita:ditavalPath
jsj1481748799576.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

Input

As in PointInPolygon Example: OutputAll ('true'):
  • SourceTable: source_passenger
  • ReferenceTable: reference_terminal

SQL Call

SELECT * FROM PointInPolygon(
  ON source_passenger AS SourceTable PARTITION BY ANY
  ON reference_terminal AS ReferenceTable 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

Download a zip file of all examples and a SQL script file that creates their input tables from the attachment in the left sidebar.