# Geo intersection inner join
> Supported in: Batch, Streaming
Inner joins left and right datasets together based on whether input geometries overlap. Includes just touching geometries in the results.
**Transform categories**: Geospatial, Join
## Declared arguments
* **Condition for columns to select on the left:** All columns in the left input schema will be tested to see if they match this condition. If they match, the column will be selected in the output.
*ColumnPredicate*
* **Condition for columns to select on the right:** All columns in the right input schema will be tested to see if they match this condition. If they match, the column will be selected in the output.
*ColumnPredicate*
* **Join key:** GeoJSON columns from the left and right inputs on which to join.
*Tuple\, Column\>*
* **Left dataset:** Left dataset to use in join.
*Table*
* **Right dataset:** Right dataset to use in join.
*Table*
* *optional* **Prefix for columns from right:** Prefix to add to all columns on the right hand side.
*Literal\*
## Examples
### Example 1: Base case
**Argument values:**
* **Condition for columns to select on the left:**
allColumns(
)
* **Condition for columns to select on the right:**
allColumns(
)
* **Join key:** (`geometryColLhs`, `geometryColRhs`)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
* **Prefix for columns from right:** *null*
**Inputs:**
ri.foundry.main.dataset.left
| geometryColLhs | col1Lhs |
| ----- | ----- |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 42.0 |
ri.foundry.main.dataset.right
| geometryColRhs | col1Rhs |
| ----- | ----- |
| {"coordinates": \[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
| {"coordinates": \[\[\[12.0, 12.0], \[17.0, 12.0], \[17.0, 17.0], \[12.0, 17.0], \[12.0, 12.0]]], "type": "Polygon"} | rhsVal2 |
| {"coordinates": \[0.0, 0.0], "type":"Point"} | rhsVal3 |
| {"coordinates": \[15.0, 15.0], "type":"Point"} | rhsVal4 |
| {"coordinates": \[\[-1.0, -1.0], \[5.0, 5.0]], "type":"LineString"} | rhsVal5 |
| {"coordinates": \[\[20.0, 20.0], \[21.0, 23.0]], "type":"LineString"} | rhsVal6 |
| {"coordinates": \[\[-1.0, -1.0], \[5.0, 5.0]], "type":"LineString"} | rhsVal7 |
| {"coordinates": \[\[20.0, 20.0], \[21.0, 23.0]], "type":"LineString"} | rhsVal8 |
| {"coordinates": \[\[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], \[\[\[12.0, 12.0], \[17.0, 12.0], \[17.0, 17.0], \[12.0, 17.0], \[12.0, 12.0]]]], "type":"MultiPolygon"} | rhsVal9 |
| {"coordinates": \[\[\[\[170.0, 170.0], \[190.0, 170.0], \[190.0, 190.0], \[170.0, 190.0], \[170.0, 170.0]]], \[\[\[12.0, 12.0], \[17.0, 12.0], \[17.0, 17.0], \[12.0, 17.0], \[12.0, 12.0]]]], "type":"MultiPolygon"} | rhsVal10 |
**Output:**
| geometryColLhs | col1Lhs | geometryColRhs | col1Rhs |
| ----- | ----- | ----- | ----- |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 42.0 | {"coordinates": \[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 42.0 | {"coordinates": \[0.0, 0.0], "type":"Point"} | rhsVal3 |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 42.0 | {"coordinates": \[\[-1.0, -1.0], \[5.0, 5.0]], "type":"LineString"} | rhsVal5 |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 42.0 | {"coordinates": \[\[-1.0, -1.0], \[5.0, 5.0]], "type":"LineString"} | rhsVal7 |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 42.0 | {"coordinates": \[\[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], \[\[\[12.0, 12.0], \[17.0, 12.0], \[17.0, 17.0], \[12.0, 17.0], \[12.0, 12.0]]]], "type":"MultiPolygon"} | rhsVal9 |
***
### Example 2: Base case
**Argument values:**
* **Condition for columns to select on the left:**
allColumns(
)
* **Condition for columns to select on the right:**
allColumns(
)
* **Join key:** (`geometryColLhs`, `geometryColRhs`)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
* **Prefix for columns from right:** *null*
**Inputs:**
ri.foundry.main.dataset.left
| geometryColLhs | lhs1 |
| ----- | ----- |
| {} | 42.0 |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 43.0 |
ri.foundry.main.dataset.right
| geometryColRhs | rhs1 |
| ----- | ----- |
| {"coordinates": \[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
**Output:**
| geometryColLhs | lhs1 | geometryColRhs | rhs1 |
| ----- | ----- | ----- | ----- |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 43.0 | {"coordinates": \[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
***
### Example 3: Base case
**Argument values:**
* **Condition for columns to select on the left:**
allColumns(
)
* **Condition for columns to select on the right:**
allColumns(
)
* **Join key:** (`geometryColLhs`, `geometryColRhs`)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
* **Prefix for columns from right:** right\_
**Inputs:**
ri.foundry.main.dataset.left
| geometryColLhs | col1Lhs |
| ----- | ----- |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 42.0 |
ri.foundry.main.dataset.right
| geometryColRhs | col1Rhs |
| ----- | ----- |
| {"coordinates": \[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
**Output:**
| geometryColLhs | col1Lhs | right\_geometryColRhs | right\_col1Rhs |
| ----- | ----- | ----- | ----- |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 42.0 | {"coordinates": \[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
***
### Example 4: Base case
**Argument values:**
* **Condition for columns to select on the left:**
columnNameIsIn(
columnNames: \[geometryColLhs],
)
* **Condition for columns to select on the right:**
columnNameIsIn(
columnNames: \[geometryColRhs],
)
* **Join key:** (`geometryColLhs`, `geometryColRhs`)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
* **Prefix for columns from right:** *null*
**Inputs:**
ri.foundry.main.dataset.left
| geometryColLhs | col1Lhs |
| ----- | ----- |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 42.0 |
ri.foundry.main.dataset.right
| geometryColRhs | col1Rhs |
| ----- | ----- |
| {"coordinates": \[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
**Output:**
| geometryColLhs | geometryColRhs |
| ----- | ----- |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | {"coordinates": \[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], "type": "Polygon"} |
***
### Example 5: Null case
**Argument values:**
* **Condition for columns to select on the left:**
allColumns(
)
* **Condition for columns to select on the right:**
allColumns(
)
* **Join key:** (`geometryColLhs`, `geometryColRhs`)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
* **Prefix for columns from right:** *null*
**Inputs:**
ri.foundry.main.dataset.left
| geometryColLhs | lhs1 |
| ----- | ----- |
| *null* | 42.0 |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 43.0 |
ri.foundry.main.dataset.right
| geometryColRhs | rhs1 |
| ----- | ----- |
| {"coordinates": \[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
| {"coordinates": \[0.0, 0.0], "type":"Point"} | rhsVal2 |
| *null* | rhsVal3 |
**Output:**
| geometryColLhs | lhs1 | geometryColRhs | rhs1 |
| ----- | ----- | ----- | ----- |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 43.0 | {"coordinates": \[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 43.0 | {"coordinates": \[0.0, 0.0], "type":"Point"} | rhsVal2 |
***
### Example 6: Null case
**Argument values:**
* **Condition for columns to select on the left:**
allColumns(
)
* **Condition for columns to select on the right:**
allColumns(
)
* **Join key:** (`geometryColLhs`, `geometryColRhs`)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
* **Prefix for columns from right:** *null*
**Inputs:**
ri.foundry.main.dataset.left
| geometryColLhs | lhs1 |
| ----- | ----- |
| *null* | 42.0 |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 43.0 |
ri.foundry.main.dataset.right
| geometryColRhs | rhs1 |
| ----- | ----- |
| {"coordinates": \[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
**Output:**
| geometryColLhs | lhs1 | geometryColRhs | rhs1 |
| ----- | ----- | ----- | ----- |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 43.0 | {"coordinates": \[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
***
### Example 7: Edge case
**Argument values:**
* **Condition for columns to select on the left:**
allColumns(
)
* **Condition for columns to select on the right:**
allColumns(
)
* **Join key:** (`geometryColLhs`, `geometryColRhs`)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
* **Prefix for columns from right:** *null*
**Inputs:**
ri.foundry.main.dataset.left
| geometryColLhs | lhs1 |
| ----- | ----- |
| {"coordinates": \[\[\[170.0, 170.0], \[190.0, 170.0], \[190.0, 190.0], \[170.0, 190.0], \[170.0, 170.0]]], "type": "Polygon"} | 42.0 |
ri.foundry.main.dataset.right
| geometryColRhs | rhs1 |
| ----- | ----- |
| {"coordinates": \[\[\[175.0, 175.0], \[195.0, 175.0], \[195.0, 195.0], \[175.0, 195.0], \[175.0, 175.0]]], "type": "Polygon"} | rhsVal1 |
**Output:**
| geometryColLhs | lhs1 | geometryColRhs | rhs1 |
| ----- | ----- | ----- | ----- |
| {"coordinates": \[\[\[170.0, 170.0], \[190.0, 170.0], \[190.0, 190.0], \[170.0, 190.0], \[170.0, 170.0]]], "type": "Polygon"} | 42.0 | {"coordinates": \[\[\[175.0, 175.0], \[195.0, 175.0], \[195.0, 195.0], \[175.0, 195.0], \[175.0, 175.0]]], "type": "Polygon"} | rhsVal1 |
***
### Example 8: Edge case
**Argument values:**
* **Condition for columns to select on the left:**
allColumns(
)
* **Condition for columns to select on the right:**
columnNameIsIn(
columnNames: \[col1Rhs],
)
* **Join key:** (`col`, `col`)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
* **Prefix for columns from right:** *null*
**Inputs:**
ri.foundry.main.dataset.left
| col | col1Lhs |
| ----- | ----- |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 42.0 |
ri.foundry.main.dataset.right
| col | col1Rhs |
| ----- | ----- |
| {"coordinates": \[\[\[2.0, 2.0], \[7.0, 2.0], \[7.0, 7.0], \[2.0, 7.0], \[2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
**Output:**
| col | col1Lhs | col1Rhs |
| ----- | ----- | ----- |
| {"type":"Polygon","coordinates":\[\[\[0.0,0.0],\[0.0,10.0],\[10.0,10.0],\[10.0,0.0],\[0.0,0.0]]]} | 42.0 | rhsVal1 |
***
### Example 9: Edge case
**Argument values:**
* **Condition for columns to select on the left:**
allColumns(
)
* **Condition for columns to select on the right:**
allColumns(
)
* **Join key:** (`geometryColLhs`, `geometryColRhs`)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
* **Prefix for columns from right:** *null*
**Inputs:**
ri.foundry.main.dataset.left
| geometryColLhs | lhs1 |
| ----- | ----- |
| {"coordinates": \[\[\[0.0, 0.0], \[5.0, 5.0], \[0.0, 10.0], \[10.0, 5.0], \[0.0, 0.0]]], "type":"Polygon"} | 42.0 |
ri.foundry.main.dataset.right
| geometryColRhs | rhs1 |
| ----- | ----- |
| {"coordinates": \[\[\[0.0, 5.0], \[2.5, 7.5], \[4.0, 5.0], \[2.5, 2.5], \[0.0, 5.0]]], "type":"Polygon"} | rhsVal1 |
| {"coordinates": \[\[\[0.0, 5.0], \[2.0, 7.0], \[4.0, 5.0], \[2.0, 3.0], \[0.0, 5.0]]], "type":"Polygon"} | rhsVal2 |
**Output:**
| geometryColLhs | lhs1 | geometryColRhs | rhs1 |
| ----- | ----- | ----- | ----- |
| {"coordinates": \[\[\[0.0, 0.0], \[5.0, 5.0], \[0.0, 10.0], \[10.0, 5.0], \[0.0, 0.0]]], "type":"Polygon"} | 42.0 | {"coordinates": \[\[\[0.0, 5.0], \[2.5, 7.5], \[4.0, 5.0], \[2.5, 2.5], \[0.0, 5.0]]], "type":"Polygon"} | rhsVal1 |
***
### Example 10: Edge case
**Argument values:**
* **Condition for columns to select on the left:**
allColumns(
)
* **Condition for columns to select on the right:**
allColumns(
)
* **Join key:** (`geometryColLhs`, `geometryColRhs`)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
* **Prefix for columns from right:** *null*
**Inputs:**
ri.foundry.main.dataset.left
| geometryColLhs |
| ----- |
| {"coordinates": \[0.0, 0.0], "type":"Point"} |
ri.foundry.main.dataset.right
| geometryColRhs |
| ----- |
| {"coordinates": \[0.0, 0.0], "type":"Point"} |
| {"coordinates": \[15.0, 15.0], "type":"Point"} |
**Output:**
| geometryColLhs | geometryColRhs |
| ----- | ----- |
| {"coordinates": \[0.0, 0.0], "type":"Point"} | {"coordinates": \[0.0, 0.0], "type":"Point"} |
***
### Example 11: Edge case
**Argument values:**
* **Condition for columns to select on the left:**
allColumns(
)
* **Condition for columns to select on the right:**
allColumns(
)
* **Join key:** (`geometryColLhs`, `geometryColRhs`)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
* **Prefix for columns from right:** *null*
**Inputs:**
ri.foundry.main.dataset.left
| geometryColLhs | lhs1 |
| ----- | ----- |
| {"coordinates": \[0.0, 0.0], "type":"Point"} | 42.0 |
ri.foundry.main.dataset.right
| geometryColRhs | rhs1 |
| ----- | ----- |
| {"coordinates": \[0.0, 0.0], "type":"Point"} | rhsVal1 |
| {"coordinates": \[15.0, 15.0], "type":"Point"} | rhsVal2 |
**Output:**
| geometryColLhs | lhs1 | geometryColRhs | rhs1 |
| ----- | ----- | ----- | ----- |
| {"coordinates": \[0.0, 0.0], "type":"Point"} | 42.0 | {"coordinates": \[0.0, 0.0], "type":"Point"} | rhsVal1 |
***
### Example 12: Edge case
**Argument values:**
* **Condition for columns to select on the left:**
allColumns(
)
* **Condition for columns to select on the right:**
allColumns(
)
* **Join key:** (`geometryColLhs`, `geometryColRhs`)
* **Left dataset:** ri.foundry.main.dataset.left
* **Right dataset:** ri.foundry.main.dataset.right
* **Prefix for columns from right:** *null*
**Inputs:**
ri.foundry.main.dataset.left
| geometryColLhs | lhs1 |
| ----- | ----- |
| {"coordinates": \[\[\[0.0, 0.0, 0.0], \[10.0, 0.0, 0.0], \[10.0, 10.0, 0.0], \[10.0, 10.0, 10.0], \[0.0, 10.0, 10.0], \[0.0, 0.0, 10.0], \[0.0, 0.0, 0.0]]], "type": "Polygon"} | 42.0 |
ri.foundry.main.dataset.right
| geometryColRhs | rhs1 |
| ----- | ----- |
| {"coordinates": \[\[\[2.0, 2.0, 2.0], \[7.0, 2.0, 2.0], \[7.0, 7.0, 2.0], \[7.0, 7.0, 7.0], \[2.0, 7.0, 7.0], \[2.0, 2.0, 7.0], \[2.0, 2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
| {"coordinates": \[\[\[12.0, 12.0, 12.0], \[17.0, 12.0, 12.0], \[17.0, 17.0, 12.0], \[17.0, 17.0, 17.0], \[12.0, 17.0, 17.0], \[12.0, 12.0, 17.0], \[12.0, 12.0, 12.0]]], "type": "Polygon"} | rhsVal2 |
**Output:**
| geometryColLhs | lhs1 | geometryColRhs | rhs1 |
| ----- | ----- | ----- | ----- |
| {"coordinates": \[\[\[0.0, 0.0, 0.0], \[10.0, 0.0, 0.0], \[10.0, 10.0, 0.0], \[10.0, 10.0, 10.0], \[0.0, 10.0, 10.0], \[0.0, 0.0, 10.0], \[0.0, 0.0, 0.0]]], "type": "Polygon"} | 42.0 | {"coordinates": \[\[\[2.0, 2.0, 2.0], \[7.0, 2.0, 2.0], \[7.0, 7.0, 2.0], \[7.0, 7.0, 7.0], \[2.0, 7.0, 7.0], \[2.0, 2.0, 7.0], \[2.0, 2.0, 2.0]]], "type": "Polygon"} | rhsVal1 |
***