WKT_SPATIAL_INTERSECT

Checks if the WKT formatted spatial objects intersect.

Syntax

WKT_SPATIAL_INTERSECT(first, second)

Arguments

Name
Type
Description
Default Value

first

string

A WKT formatted spatial object

second

string

A WKT formatted spatial object

Examples

first
second
Output

'POLYGON((-10 30, -40 40, -10 -20, 40 20, 0 0, -10 30))'

'POINT(10 0)'

true

'POLYGON((-10 30, -40 40, -10 -20, 40 20, 0 0, -10 30))'

'POINT(16 0)'

false

Transformation job example

SQL

CREATE JOB function_operator_example
    ADD_MISSING_COLUMNS = true
AS INSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data 
  MAP_COLUMNS_BY_NAME
    SELECT first, second,
        WKT_SPATIAL_INTERSECT(first, second) AS Output
    FROM default_glue_catalog.upsolver_samples.orders_raw_data
    LET first = 'POLYGON((-10 30, -40 40, -10 -20, 40 20, 0 0, -10 30))',
        second = 'POINT(10 0)'
    WHERE $commit_time BETWEEN run_start_time() AND run_end_time()
    LIMIT 1;

Query result

first
second
Output

'POLYGON((-10 30, -40 40, -10 -20, 40 20, 0 0, -10 30))'

'POINT(10 0)'

true

Last updated