Get coordinates from addresses to create Maps in Tableau

Ivett Kovács
4 min readJun 4, 2024

--

Tableau’s built-in geocoding can handle zip/postcode level data but cannot map street addresses. Addresses are a lower level of granularity than that of ZIP code. They are not available to be matched in Tableau as they’re not in the underlying database for the geocoding matching effort.

How to create an address-level map in Tableau?
You’ll need to geocode outside of Tableau or in Tableau Prep to be able to bring those lat/long pairs into your viz.

Let’s see a few solutions📍

Google Sheets

If you store your data in Google Drive and use this connection in Tableau, the best and easiest way is to install Geocode by Awesome Table extension.

Then run this extension on your Address information to get the coordinates (lot/lang).

EXCEL

The same method is available for Excel app as well. First, download the free Mapcite Excel Add-In from the Microsoft Office App Store.
Follow these steps:

  1. Click on the menu option ‘Mapcite’ in the Excel Ribbon
  2. Press ‘Geocode Data’ button
  3. Match the columns in your data with the columns expected by the Mapcite geocoder
  4. Start Geocoding
Image from Richard Crump

Alteryx

Alteryx Designer allows us to convert addresses to coordinates is straightforward with the built-in geocoding tools. To convert addresses to coordinates (latitude and longitude), you need to use the Geocoding tools available in Alteryx Designer.

  1. Install and Open Alteryx Designer
  2. Prepare Your Data: Have your data containing the latitude and longitude coordinates ready. This could be in a CSV file or any other data source supported by Alteryx.
  3. Start a new workflow in Alteryx Designer.
  4. Input Data Tool: Drag the “Input Data” tool from the “Favorites” or “In/Out” tab onto the canvas. Connect it to your data source containing the coordinates.
  5. Geocoding Tool: Use the “Reverse Geocoder” tool to convert coordinates to addresses. If you don’t see the “Reverse Geocoder” tool in your palette, you may need to install the Alteryx Data Pack or Spatial Data package which includes geocoding capabilities.
  6. Configure the Reverse Geocoder Tool and connect it to the output of your “Input Data” tool.
  7. Specify the fields that contain the latitude and longitude coordinates.

Note:

  • Ensure you have the necessary geocoding data package installed in Alteryx.
  • Verify that your latitude and longitude fields are correctly formatted and recognized by the “Reverse Geocoder” tool and always check the output data to ensure the addresses have been correctly generated.

Tableau prep with Python/R intregration

Tableau Prep Builder introduced the integration with Python and R back in 2019.3 With the Python/R integration in Tableau prep the entire geocoding process can be managed in Tableau — see the following steps:

  • Geocoding with Google API

The Google Geocoding API allows you to convert addresses into geographic coordinates (latitude and longitude). Ensure your API key has the necessary permissions and that you handle any potential errors or quota limits when using the Google Maps Geocoding API. https://developers.google.com/maps/get-started

Kelly Zhang’s post explains how to create and integrate a Python script with Tableau Prep. The script geocodes addresses to longitude and latitude using the Google Maps Geocoding API.

This approach enables the use of Tableau Prep for both forward and reverse geocoding, integrating it through TabPy. Ensure you have Permanent Geocoding enabled on your Mapbox account to utilize this solution effectively. The Mapbox Geocoding API provides global scale and data coverage. It is also available to all users but please before check the Mapbox pricing page.

Other APIs, libraries and sites for geocoding

https://www.geocod.io

Summary

Geocoding services provide APIs that allow you to convert geographic coordinates (latitude and longitude) into readable addresses, which can be incredibly useful for various applications such as location-based services, mapping, and navigation. Each service may have its own API with different usage limits, pricing models, and data quality, so it’s essential to choose one that fits your requirements best. Additionally, some services may offer additional features such as reverse geocoding (converting addresses into coordinates), place search, and routing functionalities.

What tool, API or library do you use for this purpose?

--

--

Ivett Kovács

Data Visualization Designer | Tableau Zen Master & Public Ambassador | Grayscale Studio