In Tableau 10.2, we have a new data type that is read from spatial files – the GEOMETRY field. Right now, it would seem there is not much we can do directly with these fields other than display them.
The GEOMETRY field is presented as a measure object with a single aggregation function COLLECT(). This aggregation makes a group of polygons and/or points – GEOMETRY fields can contain both – act together as a collection (hence the name) based on the dimensions included in the viz. This means they are coloured, labelled, selected, highlighted, etc. as a single mark.
Right now there are no other built-in functions for GEOMETRY fields but we can use them in calculated fields. Here’s a simple, yet interesting application allowing us to dynamically select different levels of detail.
Australia’s Bureau of Statistics reports their data spatially via Statistical Areas (SA). There are multiple levels of detail in this model from SA4 down to SA1 (and further down to mesh blocks). The boundary definitions for these areas are available from the ABS website in ESRI and MapInfo formats.
To bring this data together, we can download and join the shape files together in a single data source:
With some cleanup this results as follows – with a GEOMETRY field sourced from each file, containing the boundaries of the associated SA level:
We can create a parameter that allows the user to select which level they would like to display:
We can use this parameter in a calculated field, returning a different GEOMETRY field based on the parameter value:
CASE [Select Level] WHEN "SA1" THEN [SA1 Geometry] WHEN "SA2" THEN [SA2 Geometry] WHEN "SA3" THEN [SA3 Geometry] WHEN "SA4" THEN [SA4 Geometry] END
Double-clicking on this calculated GEOMETRY field and exposing the parameter allows the end user to display the required SA level dynamically. However, because there is no dimension in the viz, the COLLECT() aggregation makes all the polygons act as a single mark. To have each area act as a separate mark, we can use the parameter again to create a dynamic code dimension:
CASE [Select Level] WHEN "SA1" THEN [Sa1 7Dig16] WHEN "SA2" THEN [Sa2 Name16] WHEN "SA3" THEN [Sa3 Name16] WHEN "SA4" THEN [Sa4 Name16] END
I look forward to finding more cool things to do with this new spatial capability in Tableau 10.2, and reading about your tricks as well.