Geo Spatial Analytics with Tableau

Utsav
Tableautopia
Published in
4 min readSep 6, 2020
Tableau dashboard — Flight Routes

Tableau, with version 2019.2, has added a pair of geospatial functions that has eased the complexity in producing geospatial route visualizations. These are MakeLine and MakePoint functions. Another important function “Buffer” was made part of Tableau in version 2020.1 that helps to create a sphere of influence around points on map. We’ll discuss these two types of functions now with some examples.

Curved Paths

Points on map can be connected by straight paths as explained in this link. However there was no native way to create curved paths between points on map. Now we will look through some of the approaches to create curved paths in Tableau.

Approach#1

This approach expects input data in the form of KML file which is geospatial file written in XML format. The KML file can be plugged into Tableau and the curved paths would come up in seconds. Here are some links which has some workflows for the data wrangling required to achieve this.

Flights of the World: How to map great circle routes in Tableau 10.4

Flights of the World Part II: How to map great circle routes in the newest Tableau release

Approach#2

The second approach revolved around mathematical curves (like Bezier Curve) using expressions to get curve between two points. These curves are different from great circle routes as above.

DRAW CURVED LINES ON A MAP!

New Approach

This approach is based on great circle route and uses MakeLine and MakePoint functions as explained with the help of following example.

The [Type] field can be dropped on color marks card to give each path a distinguishing appearance.

Dynamic show/hide of paths on map

We will drop the calculated field ‘Source Longitude (Adjusted)’ in the columns which would make visibility of different routes on map as parameter controlled.

Custom shapes for points on map

To achieve this, we would have to duplicate Source Latitude in Rows and create a dual axis view where the second map layer will act as shapes for the points. Therefore we can drop [Source] field on shape and label marks card.

Sphere of Influence

Tableau with v 2020.1, launched ‘Buffer’ function that creates a circle around points that has many use cases like competitor effect analysis, studying impact region of campaigns, etc. This is explained using blog post as below.

HOW TO USE BUFFER SPATIAL FUNCTION IN TABLEAU

Note that in recent releases of Tableau, joins are not explicitly visible when tables are dragged and dropped to the data canvas. It would instead show relationships between the logical tables. A double click on the table would reveal the underlying physical tables where the join options would be visible. Here is a Tableau help page that explains the feature.

Join Your Data

Distance between Points on Map

‘Distance’ is the final member of the list of spatial functions available in Tableau which can evaluate distance between two spatial points. Therefore just like ‘Buffer’, the input points has to be collected using ‘Makepoint’ function. More on Spatial Functions.

Coloring points within buffer radius of points

One of the use of the Spatial functions can be to identify at risk clients in the vicinity of competitors. Based on the proximity to competitors with similar offerings, we can color the clients with with high risk of losing. This is explained as below.

Tableau Public

Touching several points we discussed so far and combining few more techniques, I have created a viz hosted on Tableau Public and link to the same can be found below.

--

--