Chapter 10 of 12

Mapping and Geospatial Analysis in Tableau

Master geographic visualization in Tableau — from symbol and choropleth maps to spatial files, custom geocoding, and spatial functions.

Meritshot17 min read
TableauMapsGeospatialGeographic Visualization
All Tableau Chapters

Mapping and Geospatial Analysis in Tableau

Geographic data tells a story that tables and bar charts cannot. When you see sales concentrated along a coastline, or a disease cluster in a specific ZIP code, the spatial pattern is instantly visible — no decoding required. Tableau's mapping capabilities range from simple symbol maps to complex spatial analysis with buffer zones and route overlays.

This chapter covers every level of geographic visualization, from built-in geocoding to connecting custom shapefiles and using spatial functions.


Why Maps? When to Use Geographic Visualization

Maps are the right choice when location is the primary analytical dimension. Ask yourself: would this insight be weaker if location were removed? If yes, use a map.

Use a Map When:

  • You are comparing values across geographic regions (states, countries, territories)
  • You need to show spatial distribution or clustering of events or customers
  • You are analyzing proximity, catchment areas, or delivery coverage
  • You are communicating findings to a non-technical audience who responds to visual geography
  • The story is fundamentally about where — not just what or when

Avoid a Map When:

  • The geographic dimension has too few values (2–3 regions) — a bar chart is clearer
  • The geographic areas have vastly different sizes (large states dominate filled maps visually even if small states have higher values)
  • Your audience needs to compare precise values — maps are poor for exact comparison; use bar charts alongside

Geographic Roles in Tableau

Tableau recognizes many geographic field types automatically when field names match known patterns (Country, State, City, ZIP Code, etc.). You can also assign geographic roles manually.

Built-In Geographic Roles

RoleDescriptionExample Values
Country/RegionNation-level geographyUnited States, Germany, India
State/ProvinceSub-national administrative areaCalifornia, Bavaria, Maharashtra
CityMunicipalityNew York, London, Tokyo
ZIP Code / Postal CodePostal delivery zones10001, SW1A 1AA
CountySub-state administrative unit (US)Los Angeles County
Area CodeUS telephone area codes212, 415
CBSA/MSAUS metropolitan statistical areasNew York-Newark-Jersey City
LatitudeDecimal degrees latitude40.7128
LongitudeDecimal degrees longitude-74.0060

How to Assign a Geographic Role

If Tableau does not recognize a field automatically (the globe icon does not appear), you can assign it manually:

  1. Right-click the field in the Data pane.
  2. Select Geographic Role.
  3. Choose the appropriate role from the submenu.

When a geographic role is assigned, Tableau generates two calculated fields automatically: Latitude (generated) and Longitude (generated). These are stored in the Measures section with a globe and ruler icon.

Custom Locations with Latitude and Longitude

If your data contains actual latitude and longitude columns (decimal degrees), you do not need Tableau's built-in geocoding. Simply:

  1. Ensure both fields have the Latitude and Longitude geographic roles assigned.
  2. Double-click Latitude — Tableau opens a map automatically.
  3. Drag Longitude to the Columns shelf (it may be placed there automatically).

Types of Maps in Tableau

Tableau supports five main map types, each suited to different analytical questions.

1. Symbol Map

What it is: Points (circles, squares, or custom shapes) placed at geographic locations, sized and/or colored by a measure.

Best for: Comparing individual locations (stores, warehouses, cities), showing point distributions.

Example: Bubble map of city-level sales, where bubble size = Sales and bubble color = Profit Ratio.


2. Filled Map (Choropleth)

What it is: Geographic regions (states, countries, counties) filled with color based on a measure value.

Best for: Showing how a measure varies across regions, especially when the audience is familiar with the geography.

Watch out for: The area-size bias problem — large geographic areas (Texas, Alaska) draw the eye even when small areas have higher values. Consider normalizing by population or using a cartogram.


3. Density Map (Heatmap of Point Data)

What it is: A spatial heatmap showing the concentration (density) of points in an area, regardless of exact location.

Best for: Visualizing clusters in large point datasets (thousands of customer locations, accident sites, call records) where individual points would overlap.

Example: Density map of taxi pickups in New York City.


4. Flow Map (Origin-Destination Lines)

What it is: Lines drawn between an origin location and a destination location, typically showing movement of people, goods, or data.

Best for: Supply chain flows, migration patterns, flight routes, freight movements.

Building it: Requires a dataset with both origin and destination coordinates, and a Path field ordering the points. Use the Path shelf and set Mark type to Line.


5. Dual-Axis Map

What it is: Two layers on a single map — for example, a filled choropleth layer underneath and symbol marks on top.

Best for: Showing regional context (filled) and specific locations (points) simultaneously — e.g., state-level sales territory color + store location bubbles.


Creating a Symbol Map: Step by Step

Using the Superstore dataset with a State field:

Step 1: Double-click the State field in the Data pane. Tableau automatically places State on the map as points (Latitude and Longitude generated fields appear on the Rows and Columns shelves).

Step 2: Change the Mark type from Automatic to Circle (if not already set).

Step 3: Drag Sales to Size on the Marks card. Larger circles now represent higher sales states.

Step 4: Drag Profit Ratio (or create SUM([Profit]) / SUM([Sales])) to Color on the Marks card. Use a diverging color palette (orange-blue) so positive profit ratios appear blue and negative appear orange.

Step 5: Drag State to Tooltip and add Sales and Profit to Tooltip as well. Format the tooltip for clarity.

Step 6: In the Size legend, click Edit Sizes and adjust the size range so the largest circle is legible without overwhelming smaller ones.

Step 7: Title the view: "Sales by State — Size = Sales, Color = Profit Ratio".


Creating a Filled (Choropleth) Map: Step by Step

Step 1: Double-click State — Tableau creates a symbol map by default.

Step 2: Change the Mark type from Circle to Map (the filled map icon — it looks like a filled region shape). The view switches from points to colored state polygons.

Step 3: Drag Sales to Color. Tableau fills each state with a shade proportional to Sales.

Step 4: Click ColorEdit Colors. Choose a Sequential color palette (e.g., Blue) for measures where higher = more. Check Stepped Color with 5–7 steps for easier categorical reading.

Step 5: Drag State and Sales to the Tooltip shelf and format: "State: [State] | Total Sales: [Sales]".

Step 6: Right-click the color legend → Edit Title → rename to "Sales ($)".

Step 7: Use Map → Map Layers to add state border lines for clarity (increase border opacity).


Map Layers and Controls

Background Map Styles

Tableau connects to Mapbox and provides several built-in background map styles. Access them via Map → Background Maps:

StyleAppearanceBest For
NoneNo background — blank canvasWhen you supply your own background image
LightWhite/pale gray basemapMost business dashboards (clean, minimal)
NormalStandard color street mapGeneral use
DarkDark gray/black basemapHigh-contrast presentations, night-mode dashboards
OutdoorsTerrain, elevation contoursEnvironmental or outdoor analysis
StreetsDetailed street-level mapStore location, last-mile delivery
SatelliteSatellite imagerySite selection, real-estate, agriculture

Map Layers Panel

Access via Map → Map Layers. Toggle geographic features on and off:

  • Land / Ocean / Coastlines — basic geography
  • Country/Region Borders — international boundaries
  • State/Province Borders — sub-national lines
  • County Borders — US county lines
  • Highways — major road network
  • Zip Code Boundaries — US postal zones

Map Controls (in the view)

  • Zoom controls — + / - buttons in the upper-left corner of the map
  • Pan — click and drag to move the map
  • Scroll to zoom — enable/disable via Map → Map Options → Scroll Wheel Zooms Map
  • Map search box — pin icon to search for and navigate to a location

Handling Unknown / Unrecognized Locations

When Tableau cannot match a location value to its geocoding database, it places a small indicator in the lower-right of the map: "X unknown" with a link to Edit Locations.

How to Fix Unknown Locations

  1. Click the X unknown indicator or go to Map → Edit Locations.
  2. Tableau shows a dialog listing unrecognized values.
  3. For each unknown, you can:
    • Match to a known location by typing the correct name in the "Matching Location" column.
    • Enter latitude/longitude directly if you know the coordinates.
    • Leave as unplotted if the location is irrelevant.

Common Causes

CauseExampleFix
Abbreviations vs full names"CA" instead of "California"Add a calculated field to expand abbreviations
Non-standard spellings"São Paulo" vs "Sao Paulo"Clean in data source or use Edit Locations
Unknown regions/territoriesCustom sales districtsUse custom geocoding (lat/long)
Multiple countries with same city"Paris" (France vs Texas)Add Country field to provide context

Custom Geocoding

When your data contains locations that Tableau does not natively recognize — custom sales territories, internal facility codes, hyper-local neighborhoods — you can import your own geocoding table.

Method 1: Adding Lat/Long Columns to Your Data

The simplest approach: add Latitude and Longitude columns to your data source directly (in Excel, SQL, or your ETL pipeline). Assign the geographic roles Latitude and Longitude to these fields in Tableau.

This works for any custom point location: hospital locations, wind turbine sites, customer head offices.

Method 2: Tableau Custom Geocoding Import

For region-type data (polygons), create a CSV file with columns:

  • Your location field name (must match exactly)
  • Latitude
  • Longitude

Go to Map → Geocoding → Import Custom Geocoding and follow the wizard. Tableau stores this in its repository and applies it whenever the matching field is used.


Spatial Files: Connecting to External Geographic Data

Tableau can connect directly to spatial file formats, enabling you to work with geographic shapes that go far beyond Tableau's built-in boundaries.

Supported Spatial File Formats

FormatExtensionDescription
Shapefile.shp (+ .dbf, .shx, .prj)Most common GIS vector format
GeoJSON.geojson / .jsonLightweight, web-native geographic format
KML / KMZ.kml / .kmzGoogle Earth format
TopoJSON.topojsonCompressed topology-preserving JSON
Esri File Geodatabase.gdbEsri enterprise GIS format
MapInfo Table.tabMapInfo proprietary format

How to Connect to a Shapefile

  1. In Tableau Desktop, go to Connect → To a File → Spatial File.
  2. Navigate to your .shp file (the .dbf, .shx, and .prj files must be in the same directory).
  3. Tableau imports the spatial file. A Geometry field appears in the Data pane.
  4. Drag Geometry to the canvas — Tableau renders the polygons.
  5. Join or blend with your data source on a matching key field (e.g., state name, region code).

Spatial Functions

Tableau 2019.2+ introduced spatial functions that allow you to perform geographic calculations directly in calculated fields.

MAKEPOINT

Syntax: MAKEPOINT(latitude, longitude)

Purpose: Creates a spatial point object from decimal-degree latitude and longitude values. Required when your data has separate lat/long columns and you want to use them in spatial calculations.

Example:

MAKEPOINT([Store Latitude], [Store Longitude])

This creates a point geometry that can then be used in DISTANCE or BUFFER calculations.


DISTANCE

Syntax: DISTANCE(point1, point2, unit)

Purpose: Calculates the geodesic (great-circle) distance between two spatial points.

Units: 'km' (kilometers), 'miles' (miles), 'm' (meters)

Example: Distance from each store to the nearest distribution center:

DISTANCE(
  MAKEPOINT([Store Lat], [Store Long]),
  MAKEPOINT([DC Lat], [DC Long]),
  'miles'
)

This is invaluable for logistics, territory management, and proximity analysis.


BUFFER

Syntax: BUFFER(point, distance, unit)

Purpose: Creates a circular polygon (buffer zone) around a point at a specified radius.

Example: Create a 5-mile catchment area around each store:

BUFFER(MAKEPOINT([Store Lat], [Store Long]), 5, 'miles')

Place this on the Detail shelf with Mark type = Map to render filled circles around each location.


INTERSECTS

Syntax: INTERSECTS(polygon, point)

Purpose: Returns True if a point falls within a polygon. Used to determine which geographic region a point belongs to — especially when your regions are custom (not Tableau's built-in geographies).

Example: Determine if a delivery address falls within a service area polygon:

INTERSECTS([Service Area Geometry], MAKEPOINT([Delivery Lat], [Delivery Long]))

Creating Store Catchment Areas with BUFFER

Scenario: A retail chain wants to visualize the 10-mile catchment area around each of its 50 stores and determine how many customers live within that area.

Step 1: Connect to a spreadsheet containing Store Name, Store Latitude, Store Longitude.

Step 2: Create a calculated field [Store Point]:

MAKEPOINT([Store Latitude], [Store Longitude])

Step 3: Create a calculated field [Catchment Area]:

BUFFER([Store Point], 10, 'miles')

Step 4: Drag [Catchment Area] to Detail. Set Mark type to Map.

Step 5: Color the circles by Store Name or a metric like [Annual Revenue].

Step 6: Join the customer address table (also with lat/long) and use INTERSECTS to count customers within each catchment:

INTERSECTS([Catchment Area], MAKEPOINT([Customer Lat], [Customer Long]))

Now you have a visual map of service coverage and an exact count of customers per catchment.


Path Maps (Flight Routes, Delivery Routes)

Path maps connect ordered points to draw lines — ideal for showing movement between locations.

How to Build a Path Map

Step 1: Your data must have: Origin (lat/long), Destination (lat/long), and a Path Order column (1 = origin, 2 = destination).

Step 2: Reshape the data so each row is one waypoint: Route ID, Point Order, Latitude, Longitude.

Step 3: In Tableau, place Longitude on Columns, Latitude on Rows.

Step 4: Set Mark type to Line.

Step 5: Drag Route ID to Detail and Point Order to the Path shelf (the line icon in the Marks card).

Tableau now draws lines connecting origin to destination for each route.

Step 6: Color lines by distance, volume, or carrier. Size lines by shipment weight or number of flights.


Map Tooltips and Highlighting

Custom Map Tooltips

Click Tooltip in the Marks card and design rich tooltips:

Location: [City], [State]
Sales: [SUM(Sales)]
Orders: [COUNT(Orders)]
Distance to HQ: [Distance] miles

Viz in Tooltip on Maps

Tableau 2017.3+ allows embedding a second visualization inside a tooltip. When the user hovers over a state on a map, a mini bar chart of monthly sales for that state appears inline. This is particularly powerful for geographic dashboards:

  1. Create a second worksheet (e.g., Monthly Sales for [State]).
  2. In the map's Tooltip editor, click Insert → Sheets → [Monthly Sales].
  3. Set the filter to use the hovered State value via the tooltip link.

Map Highlighting

Use the Highlighter shelf or dashboard highlight actions to highlight specific marks on a map. For example, clicking a store in a list highlights its location on the map — the other stores dim to light gray.


Performance Tips for Large Geographic Datasets

Geographic rendering can be computationally intensive. Apply these techniques when working with large spatial datasets.

TechniqueDescription
Use Extracts (.hyper)Spatial queries run faster on local extracts than live connections
Limit mark countAim for <50,000 marks on a map; use aggregation or clustering for larger sets
Aggregate before mappingPre-aggregate to state/country level instead of plotting individual records
Simplify geometriesReduce vertex count in shapefiles using a GIS tool before importing
Use density marksFor 100K+ points, switch to Density marks instead of individual circles
Disable unnecessary layersTurn off unused Map Layer overlays (highways, county borders)
Fixed map extentLock the zoom/pan view so Tableau doesn't re-render on every scroll
Background map cachingTableau caches background map tiles; avoid constantly changing background styles

Practice Exercises

Exercise 1: State-Level Sales Choropleth

Using the Superstore dataset:

  1. Create a filled map of Sales by State.
  2. Apply a sequential blue color palette.
  3. Add a reference line equivalent (use a separate tooltip annotation) showing whether the state is above or below the national average sales.
  4. Filter to only the continental US (exclude Alaska and Hawaii) using a geographic filter.

Challenge: Switch the map to show Profit Ratio instead of Sales, using a diverging color palette where white/neutral = break-even, blue = profitable, orange = loss-making.


Exercise 2: Dual-Axis Map with Stores

Using a dataset of store locations (or a simulated one with lat/long):

  1. Create a choropleth layer showing Sales by State.
  2. On the same map, create a symbol layer showing individual store locations as circles sized by store revenue.
  3. Combine into a dual-axis map.
  4. Ensure tooltip shows state name + state sales when hovering the choropleth, and store name + store revenue when hovering a circle.

Exercise 3: Catchment Analysis with BUFFER

Using a store location dataset with latitude/longitude:

  1. Create MAKEPOINT and BUFFER calculated fields.
  2. Render 25-mile buffers around each store as filled circles on a map.
  3. Color each buffer by the store's annual revenue.
  4. Overlay the actual store points on top (dual axis).
  5. Identify visually which stores have overlapping catchment areas (potential cannibalization).

Summary

Geographic visualization transforms spatial data into immediately understandable insights. Tableau provides a complete toolkit — from automatic geocoding to advanced spatial functions.

Key takeaways from this chapter:

  • Geographic roles tell Tableau how to interpret location fields. Assign them manually if Tableau doesn't recognize your field automatically.
  • Symbol maps show point locations (stores, cities); Filled maps show regional comparison; Density maps handle large point datasets; Path maps show movement.
  • The Map Layers panel lets you add and remove geographic overlays (borders, highways, ZIP boundaries) and choose from multiple background styles.
  • Edit Locations resolves unrecognized place names by matching them manually or with coordinates.
  • Custom geocoding handles proprietary or non-standard locations by supplying your own lat/long data.
  • Spatial files (Shapefile, GeoJSON, KML) allow you to work with custom geographic boundaries beyond Tableau's built-in regions.
  • Spatial functions — MAKEPOINT, DISTANCE, BUFFER, INTERSECTS — enable proximity analysis, catchment modeling, and spatial joins directly in Tableau calculations.
  • For performance, aggregate data before mapping, limit mark count, and use extracts for large spatial datasets.

Maps are not just decorative — they reveal spatial patterns, support location-based decisions, and make geographic data accessible to every stakeholder.