Points and Polygons in Tableau 10.2

I have previously written about how we continue to add new features to Tableau and this means that we can develop better solutions to previously difficult problems. I’d like to present another example of this – where we want to plot points and polygons together on a single Tableau map. In an earlier blog post, I had shown how we could present points and polygons together in Tableau. However in Tableau 10.1 and earlier it was a complex process that required significant data preparation.

In Tableau 10.2 we are introducing a spatial file connector that will make it much easier to plot polygons and points together. You can now simply present your  polygon data to Tableau in an ESRI shapefile, KML or MapInfo file format:

2

and Tableau can directly plot the polygons:

1

Note that this is a much less complex viz structure than in earlier versions of Tableau. We are not using a vertex list anymore – we simply double-click on the new Geometry object (the globe field in the Measures section) and Tableau takes care of the rest. Note that in the above viz we have the (generated) latitude and longitude fields on the row/column shelves and the COLLECT(Geometry) measure on the details shelf.

When we want to overlay points on this polygon map, we simply need to have our point data also presented in a spatial file format. For this example, I had raw lat/lon data in a CSV and using Alteryx I converted it to a spatial object. I also used some of Alteryx’s spatial matching features to tag each location with the nameof the SA3 region in which it is contained (it will become clear later why this was done):

9

Once again we can simply connect to the resulting shapefile:

3

and plot the points on the map – note the layout of the viz is the same as for the polygon map above with the (generated) lat/lon fields and the COLLECT(Geometry) field on details:

4

To combine the two spatial data sets we can use the new cross-data-source join feature introduced in Tableau 10 to join the two shapefiles:

5

Starting with the previous polygon map, we can CTRL-drag the longitude field on the column shelf to duplicate the map and swap the COLLECT(Geometry) field on the detail shelf of the second map to show the Geometry field from the point location data source. Set the mark type to a red circle and you will see the following:

6

If we make the map a dual axis map, we now have points and polygons shown together. Yay! This is a much simpler (and more useful) solution compared to the previous approach.

7

Finally, because both data sets have the SA3 name we can use this to highlight both a polygon and the set of points therein, allowing for interactions that previously were not easy to do:

8

So thanks, Tableau development team, for adding these new capabilities and making old, complex techniques obsolete.

Advertisements

About Alan Eldridge

Hi. I'm Alan. By day I manage the sales consulting team for Tableau Software in Australia/New Zealand. By night, I'm a caped crusader. Or sleeping. Most often it's sleeping.
This entry was posted in Uncategorized. Bookmark the permalink.

8 Responses to Points and Polygons in Tableau 10.2

  1. Pingback: Points and Polygons | The Last Data Bender

  2. Chris McClellan says:

    Great work as always 🙂 I think this would really help my current situation, but can I get some more info on the Alteryx workflow ? (although I’m trying to solve it myself right now as well).

  3. Chris McClellan says:

    I got it working for my situation, thanks again 🙂 🙂

  4. David Pires says:

    This is brilliant, great new addition. Map layers are awesome.

  5. Pingback: How to geocode thousands of addresses and make a Tableau custom polygon + point map, with a little help from FME » Tableau Picasso

  6. craigsdewar says:

    Wow – no more fake maps in the background just to get dual axis lat/longs on the same map. Love it!

  7. Chris says:

    You can actually just drag a second set of coords onto the row/col shelves and choose a different mark type (e.g. shape) to get the filled polygon map and shapes in one graph. No need for the additional data transformation.

    • Hi Chris,

      Thanks for your comment however I’m not sure what you mean by “drag a second set of coords onto the row/col shelves”. In 10.2 the spatial field is represented by the geometry field and you can’t drag that to the row/col shelves – only to the detail shelf. It is used in conjunction with the generated lat/lon fields.

      You can duplicate the lat/lon fields on the row/col shelves and then associate them with different geometry fields – that’s what I’ve done in this example. The data prep was simply to get the SA boundary data and the volunteer data correlated so they could be joined (because we don’t currently support unioning spatial files directly in Tableau).

      I hope this clarifies.

      Cheers,
      Alan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s