What’s New in Tableau 2021.1: Snowflake Geospatial Support with Map Layers

Since Tableau switched its release schedule to a quarterly cadence, there has been a steady and frequent flow of innovations. In this post, we will show two recently added features that elevate spatial analytics to the next level: Map Layers (2020.4) and Snowflake Geospatial Support (2021.1).

Map layers in Action — Dynamic switching of layers in a Dashboard (Image by the author)

Before the release of , we had to go through time-consuming workarounds if we wanted to display multiple layers or different geospatial data within the same map. We could use dual-axis maps, prebuild some fixed geo layers in another tool like Mapbox or use extensions.

But those days are over because dynamic Tableau map layers now allow us to display different geospatial data and more than two layers — including points, polygons and LineStrings — on a single map easily and quickly. This opens up great opportunities to build more advanced location-based real-time analyses in Tableau.

Let’s look at an example where geo-based analysis is essential: tracking elephant migrations in Etosha National Park.

The park, located in Namibia, uses GPS telemetry to study migration routes and the use of space by elephants. This information helps researchers identify and manage essential wildlife corridors and informs land-use policies — for example when there is high development pressure in areas that are critical for animals, and elephants in particular.

The collaring process is an expensive but worthwhile effort because the GPS collar receives signals from multiple satellites, which enables the automatic calculation of its position. Researchers can use historical data from elephant collars to help rangers to respond more quickly and effectively to poaching incidents.

Using the collars’ GPS coordinates and the corresponding historical data, we can show how these animals moved and which areas they visited during a specific period. These techniques allow us to gain insights such as how dry and wet periods and the availability of drinking water affect the movement of elephans and whether they’re part of a herd or move separately.

To find the answers, we have to combine points, polygons and LineStrings. Let’s see how we can do this using map layers on the same sheet.

Build the first layers like you would before the map layer feature update, using LineString for this example.

Then, to add the additional layers, just drag the new field onto the map view, and the Add a Marks Layer box will appear at the top of the view (Point Geometry).

That’s it. In the Mark window, you can customize the layers independently any way you want.

I added these six layers to a single map and I gave users the option to show or hide them on the dashboard.

Here is the Mark type with six layers:

hhh
hhh
https://tabsoft.co/39jm5UH

Give it a try, and if you get stuck, let us know — we’re happy to help.

Snowflake Geospatial Support

Snowflake is a leading cloud-based data storage and analytics service. It offers scalable and optimized data access (with high performance), without any hardware or environment configuration requirements. Thanks to such benefits, Snowflake has gained considerable momentum in the market. Although it’s been getting more and more popular among Tableau users, until recently, Tableau had an important limitation with regard to Snowflake connectivity: it did not support geospatial data objects, which became one of the most requested features, as this Tableau Community post shows:

At last, with the most recent , this limitation is gone, and we can host our spatial data from our Snowflake cloud data platform without issue.

Snowflake supports all the main geospatial object types like . It also allows us to store different object types in a single GEOGRAPHY column. This feature, combined with the new multilayer functionality of Tableau 2021.1, enables us to include as many spatial types as we want (combining Point, Polygon and Lines) in a single worksheet.

In this particular project, we used Snowflake to

  • collect data from different sources;
  • combine them to create a consolidated data source;
  • clean the data.

These steps enabled us to combine the elephants’ positions and movement with the territory they inhabit. In addition, we were able to add extra details like the road network of Namibia and the location of certain major safari parks within Etosha National park.

Our final Tableau Relationship data model has the following structure:

Relationship data model

Our main data table (AE_MAIN) contains a single GEOMETRY field which includes Points and Polygons.

GEOMETRY field

If we try to drag this GEOMETRY field into a worksheet, we will get the following Tableau error message:

It says that Tableau doesn’t support mixed-format geometry or geography objects yet — but don’t worry, there are workarounds. We can use the built-in Snowflake ST_DIMENSION function to create an extra column that will tell us what geography format we have. The returned values of the ST_DIMENSION function are:

  • 0 — Point;
  • 1 — Line;
  • 2 — Polygon.

We can add this new column to the database table (recommended) or create a simple Custom SQL query to define it. For demonstration purposes, we’re going to show the Custom SQL solution. Our query looks like this:

Now we can use this field to create separate geography fields in Tableau.

Point & Polygon

When we use one of these new calculated geographies, the Tableau error message doesn’t appear, and the relevant items will be visible on the map.

Now we can combine this layer with another by using the new map layer feature.

Using map layers in Tableau

You can view and download the dashboard here.

For more about Snowflake Geospatial support, visit the following links:

Connect to Spatial data from Tableau:

Data Visualization Designer | Tableau Zen Master & Public Ambassador | dataviz.love 🖤

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store