TABLEAU • MAPPING AND SPATIAL

Custom Geocoding — Use custom geocoding and resolve unknown locations

Extend Tableau's built-in geographic dictionary so every row in your dataset lands on the map.

Historical Context & Motivation

The ability to place data on a map has been a cornerstone of business intelligence since the earliest days of geographic information systems. When Tableau first introduced mapping capabilities, it relied on an internal geocoding dictionary — a lookup table that translates place names such as country, state, city, and ZIP code into latitude–longitude pairs. This built-in dictionary works beautifully for well-known administrative boundaries, but the real world is messy: organizations track data by sales territories, warehouse codes, campus buildings, custom regions, or proprietary location identifiers that no commercial geocoding service recognizes. The gap between what Tableau knows and what your data contains is precisely the problem that custom geocoding solves.

2003
Tableau's First Maps
Tableau 1.0 ships with a modest built-in geocoding dictionary covering countries, U.S. states, and ZIP codes, enabling drag-and-drop mapping for common geographic hierarchies.
2008–2010
Early Custom Geocoding Capabilities
Tableau introduced mechanisms for users to supply custom location data in earlier versions, with the feature set evolving gradually across releases. The ability to extend the internal geocoding dictionary developed incrementally rather than appearing as a single wholesale feature in any one release.
2015
Mapbox Integration
Tableau 9.2 adds support for custom Mapbox map styles and WMS servers, enriching the spatial layer ecosystem and motivating richer custom geocoding workflows for non-standard geographies.
2020
Spatial File & Calculation Support
Tableau 2020.x deepens spatial support with MAKEPOINT, MAKELINE, and native joins to shapefiles, but custom geocoding remains the go-to approach when your data uses categorical location identifiers rather than raw coordinates.
2024
Modern Hybrid Workflows
Current Tableau versions support blending custom geocoding with spatial calculations and live map layers, giving analysts a full pipeline from unknown location strings to rich, interactive cartographic visualizations.

The central question custom geocoding addresses is deceptively simple: How do you map a location that Tableau does not recognize? Whether the unrecognized location is a misspelled city, a proprietary store code, or an entirely novel geographic concept like a delivery zone, the answer follows the same pattern — supply Tableau with a mapping from your identifier to a latitude–longitude pair, and it will plot the point on the canvas.

Core Principles & Definitions

Before diving into implementation, it helps to formalize the concepts that underpin custom geocoding in Tableau. Every map visualization depends on a geocoding role — a semantic tag that tells Tableau a field represents a geographic entity. When the built-in dictionary cannot match a value, Tableau flags it as an unknown location, and the row disappears from the map. Custom geocoding is the systematic process of resolving these unknowns by extending or overriding Tableau's internal dictionary.

1

Geographic Role

A metadata annotation on a field indicating its geographic semantics (e.g., City, State, ZIP Code). Tableau uses this role to look up coordinates in its internal dictionary. You can assign roles manually via the field's context menu.
2

Unknown Location Indicator

A small gray icon (⚠) that appears in the lower-right corner of a map view when one or more values could not be geocoded. Clicking it reveals the exact unmatched values and offers options to edit locations or filter them out.
3

Custom Geocoding CSV

A structured CSV file containing columns for each level of your geographic hierarchy plus Latitude and Longitude. Importing this file into Tableau extends the internal dictionary so that your custom identifiers resolve to map coordinates.
4

Edit Locations Dialog

An interactive UI in Tableau that lets you manually match unknown values to recognized locations, set a fixed latitude/longitude, or exclude values. Useful for one-off corrections without a full CSV workflow.
5

MAKEPOINT Spatial Calculation

A Tableau calculated field function — MAKEPOINT(lat, lon) — that creates a spatial object from numeric latitude and longitude columns. An alternative to custom geocoding when your data already contains coordinates but lacks recognized place names.
KEY TAKEAWAY
Think of Tableau's built-in geocoding dictionary as a phone book that only lists major cities. Custom geocoding is like adding your own entries — your neighborhood pizza shop, your friend's unlisted cabin — so the directory can find them too. Without those entries, calls to unknown numbers simply fail; with them, every number resolves to an address.

Visual Explanation — The Custom Geocoding Pipeline

The pipeline shows how data flows from your source through Tableau's geocoder. Matched values appear on the map; unknown values trigger the warning indicator. Three strategies — Edit Locations, Custom CSV import, and MAKEPOINT() — resolve the unknowns depending on scale and data characteristics.

The diagram above captures the complete decision flow. Your data enters Tableau with string-valued location fields. Tableau attempts a dictionary lookup, and values that resolve are immediately plotted. Values that fail appear as unknown locations. At that point you choose a resolution strategy: the interactive Edit Locations dialog for a handful of corrections, a custom geocoding CSV for batch or recurring scenarios, or the MAKEPOINT() function when your data already includes numeric coordinates. In practice, the CSV approach is the most scalable and reproducible, making it the preferred solution for enterprise analytics pipelines.

How Custom Geocoding Works Under the Hood

Custom geocoding in Tableau is conceptually a key–value join. The key is a composite of every geographic hierarchy level you provide (e.g., Country + State + City), and the value is the (latitude, longitude) pair. When you import a custom geocoding CSV, Tableau merges its contents into the internal dictionary using a left-join-like strategy: if a key already exists, your values override the built-in ones; if the key is new, it is appended. Understanding this join semantics is essential for debugging situations where locations map to the wrong point.

CSV Schema Requirements

The custom geocoding CSV must follow a strict schema. Each row represents one geocodable entity, and the columns define the hierarchy. The two mandatory columns are Latitude and Longitude (decimal degrees, WGS 84). The remaining columns must use Tableau-recognized header names that correspond to geographic roles: Country, State, County, City, Zip Code, or your own custom string that will create a new role. Parent hierarchy columns are optional but strongly recommended to disambiguate locations that share names.

Custom geocoding CSV column requirements
Column NameRequired?Data TypeExample Value
CountryRecommendedStringUnited States
StateRecommendedStringCalifornia
CityAt least one identifierStringCupertino
LatitudeYesFloat (decimal degrees)37.3230
LongitudeYesFloat (decimal degrees)-122.0322

Coordinate Reference System

Tableau's mapping engine assumes coordinates in the WGS 84 (EPSG:4326) coordinate reference system, the same system used by GPS. Latitude values range from −90 to 90, and longitude values range from −180 to 180. If your source data uses a projected CRS (e.g., UTM or State Plane), you must reproject the coordinates before importing them into Tableau. Tools like pyproj in Python or PostGIS's ST_Transform make this conversion straightforward.

HAVERSINE DISTANCE (OPTIONAL VALIDATION)
d = 2R × arcsin(√(sin²((φ₂ − φ₁)/2) + cos(φ₁) × cos(φ₂) × sin²((λ₂ − λ₁)/2)))
Where R ≈ 6,371 km (Earth's mean radius), φ = latitude in radians, λ = longitude in radians. Useful for sanity-checking that custom-geocoded points are within a plausible distance of their expected locations.

Detailed Breakdown — Building the Custom Geocoding CSV

Constructing a correct custom geocoding CSV requires attention to hierarchy, naming conventions, and encoding. This section walks through the file structure and common pitfalls that trip up even experienced Tableau users.

The CSV layout uses standard Tableau geographic role names as column headers. The Store Code column (highlighted in cyan) is a custom identifier that creates a new geographic role upon import. Parent columns like Country and State disambiguate locations that share names across regions.

Common Pitfalls

  • Encoding issues: Saving a CSV from Excel on Windows may insert a UTF-8 BOM (byte order mark). Some Tableau versions silently misparse the first column header. Use a text editor or pandas.to_csv(encoding='utf-8-sig') to control the output.
  • Ambiguous names: "Springfield" exists in over 30 U.S. states. Without a State column, Tableau will resolve it to an arbitrary match or fail entirely.
  • Swapped lat/lon: A surprisingly common error. If your points appear in the ocean or in a mirror-image location, verify the column order.
  • Stale cache: Tableau caches geocoding results. After updating your CSV, you may need to clear the geocoding cache via Map → Geocoding → Remove Custom Geocoding, then re-import.

Worked Example — Mapping Company Warehouses

Suppose you work at a logistics company with 4 regional warehouses identified by internal codes (WH-EAST, WH-WEST, WH-CENTRAL, WH-SOUTH). Your sales dataset references these codes, but Tableau's built-in geocoder has no idea what "WH-EAST" means. Let us walk through the full resolution workflow using a custom geocoding CSV.

Resolving Custom Warehouse Codes via Custom Geocoding
1
Step 1 — Identify the Unknown LocationsDrag the Warehouse field onto the map shelf. Tableau displays an empty map and shows the ⚠ unknown location indicator in the lower-right corner. Click it to reveal all four codes: WH-EAST, WH-WEST, WH-CENTRAL, WH-SOUTH.
Four unknown values identified.
2
Step 2 — Obtain CoordinatesLook up the GPS coordinates for each warehouse. You can use Google Maps (right-click → "What's here?"), a geocoding API such as the Google Geocoding API or Nominatim, or an internal facility database. Record the values in decimal degrees.
WH-EAST → (40.7128, −74.0060); WH-WEST → (34.0522, −118.2437); WH-CENTRAL → (41.8781, −87.6298); WH-SOUTH → (29.7604, −95.3698).
3
Step 3 — Build the Custom Geocoding CSVCreate a CSV file with three columns: Warehouse, Latitude, and Longitude. Save it as warehouse_geocoding.csv with UTF-8 encoding. Each row contains one warehouse code and its coordinate pair.
CSV file with 4 data rows and a header row ready for import.
4
Step 4 — Import into TableauIn Tableau Desktop, navigate to Map → Geocoding → Import Custom Geocoding… and select the folder containing your CSV. Tableau scans the file, recognizes the Latitude and Longitude columns, and creates a new geographic role called "Warehouse" based on the custom column name.
New geographic role "Warehouse" added to the geocoding dictionary.
5
Step 5 — Assign the Geographic Role and VerifyRight-click the Warehouse field in the data pane, choose Geographic Role → Warehouse. Now drag it onto the map shelf again. All four warehouses appear at the correct U.S. locations. The ⚠ indicator is gone, confirming complete resolution.
All four warehouse locations are plotted correctly on the map.
💡 Pro Tip
If you plan to share the workbook via Tableau Server or Tableau Public, the custom geocoding data is embedded in the workbook file. However, if a colleague opens the workbook in Desktop without the same custom geocoding folder imported, they will see unknown locations again. Document your geocoding files alongside your workbook for reproducibility.

Strengths, Limitations & Method Comparison

Custom geocoding is not the only way to place non-standard locations on a Tableau map. Understanding when to use each approach prevents over-engineering and ensures long-term maintainability.

Comparison of location resolution methods in Tableau
CriterionEdit Locations (Manual)Custom Geocoding CSVMAKEPOINT() Calculation
Scale1–10 fixes10–10,000+ entriesUnlimited (data-driven)
ReproducibilityLow — stored in workbook, not version-controlledHigh — CSV can live in source controlHigh — coordinates come from the data source
Requires coordinates?No (can match to known place)Yes (lat/lon in CSV)Yes (lat/lon in data)
Creates geographic role?NoYes (custom role)No (creates spatial object)
Works with hierarchies?LimitedFull multi-level hierarchyNo hierarchy — flat points only
Best use caseQuick one-off corrections (typos, aliases)Custom territories, store codes, campus buildingsIoT sensor data, GPS logs, any dataset with embedded coordinates
KEY TAKEAWAY
Think of these three methods as tools on a spectrum of automation. Edit Locations is like manually correcting typos in a document — fine for a handful. A custom geocoding CSV is like building a spell-check dictionary for your domain — scalable and reusable. MAKEPOINT() is like auto-translating the entire document in real time — powerful when the translation data is already embedded. Choose the simplest tool that fits your data's characteristics.

Connection to Advanced Spatial Analysis

Custom geocoding is the entry point to a much richer spatial analytics stack in Tableau. Once your locations resolve correctly, you unlock capabilities like spatial joins, buffer calculations, and density heatmaps that would be impossible with unresolved locations. The table below maps custom geocoding concepts to their advanced counterparts, providing a roadmap for deeper exploration.

From custom geocoding to advanced spatial analysis
Custom Geocoding ConceptAdvanced ExtensionDescription
Point locations (lat/lon)MAKEPOINT + Spatial JoinJoin custom-geocoded points to polygon shapefiles (e.g., which sales territory does each store fall in?) using Tableau's native spatial join.
Custom hierarchy (Country → Store)Level-of-Detail (LOD) ExpressionsCombine custom geographic hierarchies with LOD expressions to aggregate metrics at any level — from individual store to country — in a single view.
CSV-based geocodingExternal geocoding APIs + ETLAutomate coordinate lookups via APIs (Google, Mapbox, OpenCage) in a Python or Alteryx pipeline, generating the CSV programmatically before Tableau ingestion.
Static point mapsMAKELINE + Flow MapsUse MAKELINE() to draw origin–destination arcs between custom-geocoded points, visualizing logistics routes, migration patterns, or network connections.
Manual unknown resolutionFuzzy matching preprocessingApply string similarity algorithms (Levenshtein, Jaro-Winkler) in Python to auto-correct misspelled location names before they reach Tableau, reducing unknowns at scale.

As your spatial analysis needs grow, consider integrating Tableau with dedicated GIS tools. PostGIS provides a full spatial SQL engine; QGIS offers open-source desktop GIS for complex geoprocessing; and tools like Apache Sedona extend spatial capabilities to big data environments. Custom geocoding in Tableau serves as the translation layer that connects your organization's proprietary location semantics to this broader ecosystem of geospatial computation.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain why Tableau's built-in geocoding dictionary might fail to recognize a field labeled "Distribution Center" containing values like "DC-NorthEast" and "DC-Pacific." What fundamental assumption does Tableau's geocoder make about location fields, and how does custom geocoding address this limitation?
PROBLEM 2BASIC CALCULATION
You have three campus buildings: Library (lat 42.3601, lon −71.0589), Engineering Hall (lat 42.3605, lon −71.0572), and Student Center (lat 42.3598, lon −71.0601). Write the exact contents of a custom geocoding CSV file (including the header row) that would allow Tableau to map a field called "Building" containing these three values.
PROBLEM 3INTERMEDIATE
A colleague imports a custom geocoding CSV for 200 retail stores, but after assigning the geographic role, 15 stores still appear as unknown locations. The CSV file looks correct and all 200 rows are present. Describe at least three possible causes for this partial failure and the diagnostic steps you would take for each.
PROBLEM 4APPLIED
You are building a Tableau dashboard for a food delivery startup that operates in 12 cities. Your transactional data includes a field called "Zone" with values like "Downtown-Core," "Midtown-East," and "Airport-Area" — 47 zones in total. The company adds 3–5 new zones per month. Design a complete data pipeline (from coordinate acquisition to Tableau visualization) that keeps the geocoding current. Specify tools, file formats, scheduling, and how you would handle the ongoing updates.
PROBLEM 5CRITICAL THINKING
Compare and contrast the custom geocoding CSV approach with the MAKEPOINT() spatial calculation approach from both a software engineering and a data modeling perspective. Under what circumstances would you argue that MAKEPOINT() is architecturally superior to custom geocoding, and under what circumstances would the reverse be true? Consider maintainability, separation of concerns, performance, and the principle of a single source of truth.

Lesson Summary

Tableau's built-in geocoding dictionary maps standard geographic entities to coordinates, but real-world datasets frequently contain proprietary identifiers that the dictionary cannot resolve, triggering unknown location warnings. Custom geocoding solves this by importing a structured CSV file — containing hierarchy columns, latitude, and longitude — that extends the internal dictionary. The CSV must use WGS 84 decimal degrees, Tableau-recognized column headers, and UTF-8 encoding. For small corrections, the Edit Locations dialog offers a manual alternative, while the MAKEPOINT() function creates spatial objects directly from coordinate columns in your data, bypassing the dictionary entirely.

Choosing the right strategy depends on scale and data architecture: Edit Locations suits one-off fixes, the custom geocoding CSV excels for reusable dimensional lookups across workbooks, and MAKEPOINT() is ideal when coordinates are embedded in every record. Once locations are resolved, you unlock advanced capabilities including spatial joins, flow maps with MAKELINE(), and density heatmaps — transforming a flat dataset into a rich geospatial narrative.

Varsity Tutors • Tableau • Custom Geocoding — Use custom geocoding and resolve unknown locations