Tableau Course
Advanced Geospatial Analysis
Tableau's built-in map engine goes well beyond plotting points on a country outline. This lesson covers custom territories, spatial file connections, distance calculations, multi-layer maps with filled regions and point overlays, and how to handle data that Tableau cannot geocode automatically.
Built-in Geocoding vs Custom Spatial Data
Tableau ships with a geocoding database that recognises country names, US states, postal codes, airport codes, and a growing list of cities. When your geographic field matches a known level, Tableau automatically assigns latitude and longitude. When it does not match — custom sales territories, delivery zones, campus buildings — you need to bring your own geometry.
| Scenario | Tableau Geocodes It? | Solution |
|---|---|---|
| Country, state, city, postal code | Yes — automatic | Assign geographic role, drop on map |
| Custom sales territory names | No | Groups/Sets or spatial file join |
| Latitude / longitude columns in data | Yes — assign roles manually | Right-click field → Geographic Role |
| Polygon regions (Shapefile / GeoJSON) | No | Connect to spatial file directly |
| Ambiguous city name (e.g. Springfield) | Partial — shows unknown | Add Country/State disambiguation fields |
Connecting to Spatial Files
Tableau connects natively to three spatial file formats. Each stores polygon or point geometry that Tableau renders as filled shapes or precise point locations — neither of which standard geocoding can produce.
The industry standard for GIS polygon data. Always comes as a bundle of at least three files: .shp (geometry), .dbf (attribute table), .shx (index). Connect via Connect → Spatial file — point Tableau at the .shp file and it reads the full bundle automatically.
A lightweight JSON-based spatial format increasingly common for web data and APIs. Single file, easy to inspect in a text editor. Government open data portals frequently publish boundaries as GeoJSON. Connect the same way — Connect → Spatial file.
Common in UK and Australian government datasets. Structured similarly to Shapefile — a bundle of files (.tab, .dat, .map, .id). Less common than Shapefile or GeoJSON in modern workflows but fully supported by Tableau.
Building Custom Territories with Groups
When you need to group standard geographies — states, counties, postal codes — into custom territories without a spatial file, Tableau Groups solve the problem in minutes.
Multi-Layer Maps — Filled Regions with Point Overlays
The most powerful retail and logistics maps combine two layers: a filled polygon layer showing regional performance, and a point layer showing individual store or event locations on top. Tableau builds this with dual-axis maps.
Distance Calculations in Tableau
Tableau's DISTANCE() function calculates the straight-line (great-circle) distance between two geographic points. It is the foundation for radius analysis, delivery zone checks, and nearest-store calculations.
DISTANCE( MAKEPOINT([Store_Lat], [Store_Long]), MAKEPOINT(51.5074, -0.1278), // London HQ 'km' )
DISTANCE( MAKEPOINT([Store_Lat], [Store_Long]), MAKEPOINT(51.5074, -0.1278), 'km' ) <= 50
// Create parameter: [Radius km] — Integer, default 50, range 10–200 DISTANCE( MAKEPOINT([Store_Lat], [Store_Long]), MAKEPOINT(51.5074, -0.1278), 'km' ) <= [Radius km]
Buffer Circles on Maps
A buffer is a visible circle drawn around a point at a set radius. Tableau does not draw true buffer circles natively, but they can be approximated using a generated set of points on a circle and connecting them with a polygon mark.
Fixing Unknown Geocoding Results
When Tableau cannot geocode a location it marks it as Unknown and excludes it from the map. The status bar at the bottom of the view shows a count of unknown marks — always check this before publishing a map view.
| Common Cause | How to Fix |
|---|---|
| Ambiguous city name | Add Country and State fields to the view as additional geocoding disambiguation levels. Right-click the Unknown indicator → Edit Locations to manually assign. |
| Misspelled location name | Click the Unknown indicator in the status bar → Edit Locations → manually match unrecognised names to known locations from the dropdown. |
| Wrong geographic role assigned | Right-click the field in the Data pane → Geographic Role → select the correct level (e.g. change from City to Postal Code). |
| Custom location not in Tableau's database | Import a custom geocoding file: Map menu → Geocoding → Import Custom Geocoding. Supply a CSV with location name, latitude, longitude, and geographic level. |
Map Layer Options and Background Styling
The Map menu → Map Layers panel controls every visual element of the Tableau base map. For analytical dashboards, stripping the map back to its essentials makes data overlays read more clearly.
Normal → full street map detail. Light → muted colours, good for overlaying data. Dark → high contrast, strong for point maps with bright colours. Streets → road-level detail. Outdoors → topographic. None (Offline) → no base map, just your data shapes.
Turn off: coastline, country borders, state borders, county borders, city labels — each independently. For a clean filled-region map, keep only the base wash colour and your data layer. Turn on terrain for environmental or agricultural data.
The dual-axis map is the most useful pattern in advanced geospatial work — filled polygons for regional context, circles for individual locations. The key mistake to avoid is putting the same data on both layers. Keep layer 1 (polygons) aggregated at the region level and layer 2 (points) at the individual record level. Mixing aggregation levels on the same layer produces confusing results. Use the Map Layers panel to set the background style to Light before presenting — the muted base map lets your data colours do the visual work.
Practice Questions
1. A colleague has a Shapefile of custom delivery zones and wants to colour each zone by total deliveries. What are the steps to connect the Shapefile and join it to the deliveries data in Tableau?
2. How would you build a calculated field that filters a map to show only stores within a user-controlled radius of a fixed head office location?
3. A map view shows 12 Unknown marks in the status bar. How do you identify which locations are unrecognised and what are the possible fixes?
Quiz
1. A sales manager wants a map showing three custom sales territories made up of existing US states — no Shapefile is available. How do you create this in Tableau without any external files?
2. How is a dual-layer map built in Tableau — filled regions as layer 1 and store location circles as layer 2?
3. What does the DISTANCE() function calculate in Tableau, what does MAKEPOINT() do, and what kind of analysis does this combination enable?
Next up — Lesson 58: Predictive Modeling in Tableau — using built-in trend lines, forecasting, R and Python integration, and interpreting statistical model outputs directly in your dashboards.