Tableau Maps: Working with coordinates data
Updated: Sep 3, 2020
In one of previous article we explored how to create a simple filled map in Tableau which was simple, fun and quite informative. In this article we would like to extend this topic on maps further, by showing you how to work with coordinates data when latitude and longitude details are provided. And why is that? As you may be aware the data field is quickly changing due to influx of data coming in different variety and volume, business demands are also changing and therefore developers and analysts need to up their game by learning different ways of handling these business demands/questions.
Related: How to create a simple filled map.
So, what is our goal in this article? We will be using data on Health facilities in Kibera, to rebuild one of the previous dashboard we published and can be accessed here. (i.e. Plotting the location of different health facilities in Kibera slum Nairobi).
Here is snap shot of the data;
Using the link provided above, download the data, connect it to Tableau app to follow along.
Step 1: Plot location of health facilities
Drag the measure field ‘Longitude’ and ‘Latitude’ to the columns shelf and rows shelf respectively.
Note this gives us an outline of Kenyan map with a single dot as show below.
To plot, each single location of health facilities we’ll need to dis-aggregate measures in the following way;
Select Analysis menu >> then uncheck ‘Aggregate measures’.
See the resulting view.
Notice that in the above view, although the different health facilities are well mapped based on the coordinates, it’s hard to related them with different physical land marks like roads we all know. To add this on our view, we’ll need to import this capability from Mapbox, by integrating our Tableau map with a basic map designed in Mapbox with all these physical layers like roads added.
(At this point you can Sign in or Sign up with Mapbox and create a basic map based on the location i.e. Nairobi for this case).
Step 2: Copy Mapbox integration URL for Tableau
Open the basic map you’ve created in Mapbox, (mine is called ‘nairobi’).
Select ‘Share and use’ >> Use >> Third party >> Tableau
Copy the integration URL.
Step 3: Use Mapbox integration URL in Tableau
To apply this;
Select Map Services... under Background Maps.
On the pop-up box, select Add… >> Mapbox Maps…
On the menu that pops up;
Paste the Integration URL copied in Mapbox on the field named URL to populate other fields.
Enter the style name and press okay.
Executing above we’ve.
With Tableau update, you can now add these mapping capabilities without going to Mapbox. To do so, go to Map menu >> Map Layers....
Under Style choose Streets
Note that this is a more informative view as users can see location of health facility in-relation to different land marks like, Southern by-pass, Nairobi golf club and various street roads.
Other analytical metrics can be added with the help of color and Size by dragging the particular metrics to the respective shelves. For instance, to view the operators of these facilities, one can drag the dimensions field ‘Operator’ to the color shelf.
See the resulting view below.
From this view, one can tell that majority of facilities are operated by private owners followed by the government. Using radial selection, users can find the number of facilities within a certain mile radius from a point. To explore more on this capability kindly use the dashboard published here.
I hope this article was helpful to you. To receive more of the Tableau tips and tricks, kindly join our mailing list by subscribing below.
Thank you for reading.