Tableau Lesson 57 – Advanced Geospatial | Dataplexa
Section IV — Lesson 57

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.

Shapefile (.shp)

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.

GeoJSON (.geojson)

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.

MapInfo (.tab)

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.

1
Connect → Spatial file → navigate to your .shp or .geojson file. Tableau loads the geometry field automatically — it appears as a Geometry data type in the Data pane, shown with a globe icon.
2
Drag the Geometry field to the canvas. Tableau renders the polygons as filled shapes. The mark type automatically sets to Map.
3
Join the spatial file to your data table on a shared key field (e.g. region name, postcode). On the Data Source canvas, drag both sources and join on the matching field. Your metrics are now attached to each polygon.
4
Drag a metric to Colour — each polygon fills by value. Drag the region name to Label and Tooltip. Format the colour palette to match your dashboard theme.

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.

1
Build a standard map: drag State to the canvas → Tableau draws a filled state map. Right-click State in the Data pane → Create → Group.
2
In the Group dialog, select the states that belong to Territory 1 → click Group. Rename the group. Repeat for each territory. Click OK — the new grouped field appears in the Data pane.
3
Drag the new State (group) field to the Colour shelf — each territory gets a distinct colour. Drag it to Detail as well to maintain the state-level polygon outlines within each territory colour block.
Custom territory map — three sales regions from grouped states
Sales Territory Map — Three Custom Regions West CA, OR, WA, NV Central TX, CO, IL, MN East NY, FL, PA, MA West Central East Dashed lines = state borders within territory

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.

1
Layer 1 — Filled polygons: Drag State (or your Geometry field from a spatial file) to the canvas. Colour it by a regional metric (e.g. Revenue). Mark type: Map (filled).
2
Layer 2 — Point overlay: Drag Longitude to the Columns shelf. Drag Latitude to the Rows shelf. Right-click the second Latitude pill → Dual Axis. A second Marks card appears — set its mark type to Circle.
3
On the Circle Marks card: drag Store Name to Detail, Sales to Size (larger circle = higher sales), and set a contrasting colour — orange #f97316 shows clearly over the blue filled regions.
4
On the Map Marks card (polygon layer): set the polygon colour transparency to 70% — this lets the point markers underneath show through and reduces visual competition between the two layers.
Dual-layer map — filled states + store location circles
Regional Revenue + Store Locations — Dual-Layer Map Largest store Top revenue Region revenue (blue = higher) Store location (size = sales)

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 from a fixed point (e.g. head office) to each store
DISTANCE(
  MAKEPOINT([Store_Lat], [Store_Long]),
  MAKEPOINT(51.5074, -0.1278),  // London HQ
  'km'
)
MAKEPOINT() converts two decimal degree columns into a geographic point. DISTANCE() returns the great-circle distance in the specified unit ('km' or 'miles'). Replace 51.5074, -0.1278 with your fixed reference point's coordinates.
Radius filter — show only stores within 50 km of HQ
DISTANCE(
  MAKEPOINT([Store_Lat], [Store_Long]),
  MAKEPOINT(51.5074, -0.1278),
  'km'
) <= 50
Place this Boolean calculation on the Filters shelf → True → to show only stores within 50 km. Combine with a Parameter to make the radius interactive — the user drags a slider and the map updates.
Interactive radius — replace fixed 50 with a Parameter
// 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.

1
Create a scaffold data source with one row per degree (0–359) — a simple integer sequence. Join this to your store data so each store gets 360 point rows representing one full circle.
2
Calculate the lat/long of each point on the circle using trigonometry. The radius in degrees = radius_km / 111.0 (approximate km per degree at mid-latitudes). Point lat = store_lat + radius * COS(RADIANS(degree)). Point long = store_long + radius * SIN(RADIANS(degree)).
3
Plot the buffer as a second layer in a dual-axis map: Polygon mark type, path ordered by degree, colour set to transparent fill with a visible border. This creates a clear radius ring on the map around each store or location.

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.

Background style options

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.

Layer toggles to consider

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.

📌 Teacher's Note

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.