# Using the Intersect Function in Tableau for Spatial Analysis | New in Tableau 2022.4

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2023-01-05
- **Format:** Video · 21 min watch · transcript available
- **Topics:** Data visualisation, Analytics
- **Tools:** Tableau (buffer, calculated fields, cloud, intersect, makepoint, maps, parameters, split)
- **Canonical:** https://just-tim.com/posts/using-the-intersect-function-in-tableau-for-spatial-analysis-new-in-tableau-2022-4
- **Watch:** https://www.youtube.com/watch?v=biVaTCbwhJE

I walk through Tableau 2022.4's new INTERSECT function to answer how many trees sit within one kilometre of the Empire State Building. Working entirely in the browser on Tableau Cloud, I upload New York's 2015 tree census, build a point of interest from Google Maps coordinates, draw a dynamic buffer, and use INTERSECT to count the trees inside it.

## Key takeaways

- INTERSECT returns a Boolean when two geometries match, and currently supports points-in-polygons, lines-in-polygons and polygons-in-polygons matching.
- You can capture latitude and longitude from Google Maps and parse them with SPLIT, then convert to FLOAT to build a usable point of interest.
- MAKEPOINT plus BUFFER lets you draw a search zone, and feeding a range parameter into the buffer makes the radius dynamic.
- INTERSECT works at row level on a single data set, so loading points of interest into a parameter sidesteps the mixed-aggregation limitation between two separate data sets.
- All of this runs in the browser on Tableau Cloud, including uploading a 256MB CSV, though performance slows noticeably with hundreds of thousands of points.

## Chapters

- 0:00 The question and uploading the data
- 2:10 Grabbing a point of interest from Google Maps
- 4:59 Building the point with SPLIT and FLOAT
- 9:22 Creating a dynamic buffer
- 12:09 Bringing in the tree locations
- 14:22 Using the INTERSECT function
- 15:39 Mapping and formatting the trees
- 17:44 The answer and switching locations
- 18:54 Quirks and limitations of INTERSECT

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/using-the-intersect-function-in-tableau-for-spatial-analysis-new-in-tableau-2022-4

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
