Add Images of Google Maps and OpenStreetMap as Background Images in Tableau
You can add images of Google Maps or OpenStreetMap as static background images in Tableau, and then plot data points onto them. To plot data points onto a background image of GoogleMaps or OpenStreetMap, you need both latitude and longitude coordinates of your data.
This topic describes how to obtain latitude and longitude coordinates for Google Maps and OpenStreetMap, as well as how to plot them on a background image in Tableau.
Step 1: Find your map coordinates
Follow the steps below to find map coordinates for Google Maps or OpenStreetMaps.
Option 1: Map data points onto Google Maps
-
Go to http://www.gorissen.info/Pierre/maps/googleMapLocation.php(Link opens in a new window) and locate the geographic area that you want to plot data points.
-
Once you have located the area you want, hover over the easternmost side of the area and write down the longitude coordinate (displayed in the bottom-right corner of the map). Do the same for the westernmost side of the area.
-
Hover over the northernmost part of the area and write down latitude coordinate. Do the same for the southernmost part of the area.
You should now have two latitude coordinates (one top and one bottom) and two longitude coordinates (one east and one west).
You will use these coordinates to define the scale of your background image in Tableau, and to ensure that you can plot data points onto the image using latitude and longitude coordinates.
-
Take a screenshot of your map and save it to your computer.
-
Follow the steps in "Step 2: Add your map image as a background image " to add the image as a background image in Tableau.
Option 2: Map data points onto a map in OpenStreetMap
-
Go to http://www.openstreetmap.org(Link opens in a new window) and zoom in on the geographic area you want to plot data points.
-
On the top menu bar, click Export.
The Export pane provides the latitude and longitude coordinates of the area in the view. You can edit these coordinates to select a different area.
-
Write down the coordinates displayed in the box.
-
On the right side of the page, click the share icon, and then click the Download button.
-
Follow the steps listed in "Step 2: Add your map image as a background image " to add the image as a background image in Tableau.
Step 2: Add your map image as a background image
-
Open Tableau Desktop and connect to the data you want to plot on the map image.
-
Select Maps> Background Images, and select the data source you want to use to plot data on your background image.
-
In the Background Images dialog box, click Add Image.
-
In the Add Background Image dialog box, click Browse, and then navigate to the location of the map image you created earlier in Step 1: Find your map coordinates.
-
In the Add Background Image dialog box, do the following:
For the X Field drop-down list, select Longitude (generated).
In the Left box, type the easternmost longitude in your map image.
In the Right box, type the westernmost longitude in your map image.
For the Y Field drop-down list, select Latitude (generated).
In the Bottom box, type the southernmost latitude in your map image.
In the Top box, type the northernmost latitude in your map image.
-
When finished, click OK in both the Add Background Image and Background Images dialog boxes.
-
Select Maps>Background Maps>None.
The background image shows up only if there is no background map.
-
From the Measures pane, drag Latitude (generated) to the Rowsshelf and Longitude (generated) to the Columnsshelf.
Your background image should appear in the view. If it does not, or if it appears at the wrong scale, complete the following steps to fix your axes.
-
In the view, double-click the Y axis.
-
In the Edit Axis dialog box, under Range, select Fixed.
-
In the Fixed start text box, enter the bottom most longitude in your map image.
-
In the Fixed end text box, enter the top most longitude in your map image.
-
Click OK.
-
Repeat steps 9 - 13 for the other axis.
To learn how to plot your data on the background image, see steps 1, 2, and 4 in Find Background Image Coordinates(Link opens in a new window).
See also:
Use Background Images in Your Views(Link opens in a new window)
Find Background Image Coordinates(Link opens in a new window)
Use Mapbox Maps(Link opens in a new window)
Use Web Map Service (WMS) Servers(Link opens in a new window)