Tableau Lesson 30 – Geospatial Analytics | Dataplexa
Section III — Lesson 30

Geospatial Analysis

Geospatial analysis in Tableau goes beyond plotting points on a map — it includes spatial joins, custom territories, distance calculations, and polygon-based filtering that let you answer complex location questions directly inside Tableau without external GIS tools.

Custom Territories — Grouping Locations Your Own Way

Tableau's built-in geographic hierarchy (Country → State → City) reflects standard administrative boundaries. But businesses rarely operate on standard boundaries. A sales team may cover custom territories — the Southeast territory might include Florida, Georgia, Alabama, and Mississippi but not the Carolinas. Custom territories let you define these groupings directly inside Tableau without altering the source data.

1
Build a filled map of Sales by State. On the map view, hold Ctrl and click each state that belongs to a custom territory — for example, click Florida, Georgia, Alabama, and Mississippi to select them all. The selected states highlight in the view.
2
Click the tooltip that appears on the map and select Group. Tableau creates a new Group field — State (group) — in the Data pane. Rename the group to Southeast Territory. Repeat for all other custom territories.
3
Drag the new State (group) field to the Color channel. The map now shows your custom territory boundaries coloured by group — each territory is one solid colour regardless of state lines within it.

Custom Territory Map — Labelled Mockup

State (group) — Four custom sales territories · Filled map
West CA, WA, OR NV, AZ, CO Central TX, KS, MO IA, MN, IL Southeast FL, GA, AL MS, SC, TN Northeast NY, PA, NJ MA, CT, VA Not assigned West Central Southeast Northeast

Spatial Files — Bringing in External Boundaries

For boundaries that Tableau does not have built in — custom sales territories from a CRM, school catchment areas, flood zones, delivery radius polygons — you can import external spatial files directly as a data source. Tableau supports the following spatial file formats:

.shp
Shapefile — the most common GIS format, requires .shp + .dbf + .shx files together
.geojson
GeoJSON — a JSON-based format widely used for web mapping and APIs
.kml / .kmz
Keyhole Markup Language — Google Earth format, commonly used for territory exports
.topojson
TopoJSON — a compact GeoJSON extension that encodes topology
.tab
MapInfo TAB format — common in enterprise GIS environments
Spatial DB
Spatial tables from PostGIS, SQL Server, Oracle Spatial with geometry columns

Spatial Joins — Combining Point Data with Polygon Boundaries

A spatial join combines a dataset of point locations (such as customer addresses with latitude and longitude) with a dataset of polygon boundaries (such as a shapefile of sales territories) to determine which polygon each point falls inside. The result is a joined table where every customer row gains a Territory field — without any geocoding service or external processing.

1
Connect to your customer data table (containing Latitude and Longitude columns) as the primary data source. Then add the spatial file (shapefile or GeoJSON of territory boundaries) as a second connection on the Data Source tab.
2
Drag both tables onto the Data Source canvas. Tableau detects the spatial columns and opens the Join dialog. Set the join type to Inner and the join condition to Intersects — matching customer points to the territory polygon they fall inside.
3
The resulting joined dataset gains a Territory Name column from the shapefile. Every customer row now knows its territory. Build a map coloured by Territory and sized by Sales — the spatial join is complete and fully usable as a Dimension in any chart.

Spatial Join — Data Flow Mockup

Spatial Join — Customer Points × Territory Polygons → Joined Table
Customer Points
● Lat / Long
Customer ID
Sales
Order Date
INTERSECTS
Spatial Join
Territory Polygons (.shp)
▬ Geometry
Territory Name
Region Manager
Target Revenue
Joined Result
Customer ID
Sales
Order Date
← Territory Name ✓
← Region Manager ✓

Buffer Zones and Distance Analysis

Tableau supports the BUFFER() spatial function which creates a circular polygon of a specified radius around a point. This is useful for proximity analysis — for example, identifying all customers within 50 miles of a warehouse, or all stores within 10 kilometres of a competitor location. The BUFFER() function is used in a calculated field:

BUFFER(MAKEPOINT([Latitude], [Longitude]), 50, 'mi')

MAKEPOINT() converts a pair of Latitude and Longitude number columns into a Tableau geometry object. BUFFER() then expands that point into a circle of the given radius. The supported distance units are 'mi' (miles), 'km' (kilometres), 'm' (metres), and 'ft' (feet).

📌 Teacher's Note

Geospatial analysis is where Tableau starts to replace tools that analysts previously needed ArcGIS or Python's GeoPandas library for. The spatial join with Intersects is particularly powerful because it answers the most common territory question in business — "which territory does this customer belong to?" — without any programming and without modifying the source data. The BUFFER() and MAKEPOINT() functions are relatively recent additions to Tableau and are only available when your geographic data comes from coordinate columns rather than named place fields. If your data has a Latitude column and a Longitude column as numbers, MAKEPOINT converts them into geometry objects that BUFFER, spatial joins, and DISTANCE() calculations can all act on. The DISTANCE() function — DISTANCE(MAKEPOINT([Lat1],[Long1]), MAKEPOINT([Lat2],[Long2]), 'km') — calculates the straight-line distance between any two coordinate pairs, opening up nearest-location analysis, delivery radius checks, and territory assignment validation directly inside a calculated field.

Practice Questions

1. On a filled map, you want to group Florida, Georgia, Alabama, and Mississippi into a single Southeast Territory. How do you create this custom territory directly on the map?

2. You have a warehouse locations table with Latitude and Longitude columns. Write the calculated field that creates a 50-mile delivery radius polygon around each warehouse.

3. You are joining a customer points table to a territory shapefile on the Data Source tab. Which join condition correctly assigns each customer to the territory polygon containing their location?

Quiz

1. A dataset has separate Latitude and Longitude columns stored as decimal numbers. Before using BUFFER() on them, which function must be applied first?


2. A colleague has custom delivery zone boundaries exported from their CRM as a .geojson file. Can Tableau connect to this file directly as a data source?


3. A sales manager needs a map where each territory matches the company's custom regional boundaries — not US Census regions or standard state groupings. The simplest Tableau approach that requires no external spatial files is?


Next up — Lesson 31: Filters in depth — understanding the full filter order, context filters, and building interactive filter controls for dashboards.