This article describes how to assign a geographic role to a field in Tableau so you can use it to create a map view.
A geographic role associates each value in a field with a latitude and longitude value. When you assign a geographic role to a field, Tableau assigns latitude and longitude values to each location in your data based on data that is already built in to the Tableau map server.
Assigning a geographic role based on the type of location (such as state versus postcode) helps insure that your data is plotted correctly on your map view. For example, you can assign the City geographic role to a field that contains a list of city names.
When a field is assigned a geographic role, Tableau creates a map view when you add the field to Detail on the Marks card. In other words, Tableau geocodes the information in that field.
To assign a geographic role to a field:
In the Data pane, click the data type icon next to the field, select Geographic Role, and then select the geographic role you want to assign to the field.
When you assign a geographic role to a field, Tableau adds two fields to the Measures area of the Data pane: Latitude (generated) and Longitude (generated).
These fields contain latitude and longitude values and are assigned the Latitude and Longitude geographic roles. If you double-click each of these fields, Tableau adds them to the Columns and Rows shelves and creates a map view using the Tableau background map.
The following table describes the geographic roles available in Tableau. Many of the roles are international, but some are limited to the U.S. only.
You can assign geographic roles to your fields based on the type of geographic data they contain. For example, you can assign the Airport geographic role to a field that contains International Air Transport Association (IATA) codes.
If your location data does not fit into one of these roles, you may have to import custom geocoding to plot the data on a map. For more information, see Geocode Locations Tableau Does Not Recognize and Plot Them on a Map(Link opens in a new window).
|Geographic Role||Assign this role to a field if it contains:|
|Airport||International Air Transport Association (IATA) or International Civil Aviation Organization (ICAO) airport codes.|
|Area Code (U.S.)||U.S. telephone area codes; numbers only.|
|CBSA/MSA (U.S.)||U.S. Core Based Statistical Areas (CBSA), which includes Metropolitan Statistical Areas (MSA), as defined by the U.S. Office of Management and Budget. CBSA/MSA Codes and Names are recognized.|
|City||Worldwide cities with population of 15,000 or more. Names are in English (UK or US), French, German, Spanish, Brazilian-Portuguese, Japanese, Korean, and Chinese (Simplified and Traditional).|
|Congressional District (U.S.)||U.S. congressional districts.|
|Country/Region||Worldwide countries, regions, and territories. Names are in English (UK or US), French, German, Spanish, Brazilian-Portuguese, Japanese, Korean, and Chinese (Simplified and Traditional). Tableau also recognizes, FIPS 10, ISO 3166-1 alpha 2, and ISO 3166-1 alpha 3. Names are included in various forms, including long, short, and various abbreviations.|
|County||Second-level administrative divisions for select countries. For example, U.S. counties, French départements, German kriese, etc.
Note: Second-level administrative division definitions vary by country. In Tableau, all second-level administrative divisions are geocoded with the County geographic role. For more information, see the Location Data that Tableau Supports for Building Map Views section.
|NUTS Europe||NUTS (Nomenclature of Territorial Units for Statistics) levels 1 - 3 codes. Codes and names, including synonyms, are supported.|
|Latitude||Latitude in decimal degrees. Only available for numeric fields.|
|Longitude||Longitude in decimal degrees. Only available for numeric fields.|
|State/Province||Worldwide state, province, and other first-level administrative divisions. Names are in English (UK or US), French, German, Spanish, Brazilian-Portuguese, Japanese, Korean, and Chinese (Simplified and Traditional). Note: Some names are available only in their local form.|
|ZIP Code/Postcode||ZIP codes and postcodes for select countries. For example, U.S. five-digit zip codes, Australian four-digit postcodes, German five-digit postcodes, etc. For more information, see the Location Data that Tableau Supports for Building Map Views(Link opens in a new window) section.|