Getting Spatial Data in to Tableau
If you haven’t yet see Tableau Software run over to their web site and check it out now. In a nutshell Tableau software is a desktop tool that allows users to quickly analyze reams of data, from multiple formats extremely fast. You can use it to create some remarkable visualizations from data that is probably already in your database. Of course the first thing we wanted to try is visualizing and analyzing spatial data.
Tableau is not (nor does it pretend to be) a GIS tool. But it does have some basic ability to represent spatial data. Tableau requires you to flatten out the data by essentially pulling out each vertex in to its own row:
The tricky part to this turned out to be the VERTEX_TYPE. Any geospatial veteran will immediately recognize that this column is meant to identify island polygons in the data. However nobody at Tableau could us what the valid range of values were, so we had to guess. FME seemed to be the most logical tool to use to try to flatten out the data.
Using a combination of ListBuilders, Choppers and ListExploders I was able to get 80% of the way towards building a ‘Tableau Loader’ which could take any vector data and flatten it out to almost any RDBMS.
However this really does not handle the mysterious vertex type. The transformation simply treats everything as interior polygons which results on strange spikes and lots of self-intersecting lines any time it encounters a interior lake or other real world island. The challenge is in trying to determine the point order for interior and exterior polygons. After several hours on the phone with Tableau and working with four different tech people, no body could tell me what the proper ordering for the vertex points should be. Since this work there have been a few more examples posted which should all work with relatively simple data.
We shifted gears back to trying to represent point information. Since a lot of the data we deal with on a regular basis is raster based, its relatively easy to represent as points. Using this approach we were very quickly able to generate some simple dashboards on sub-national level population statistics.
After the visualization is created using the desktop software its a snap to publish out to their hosted, public facing server. You can see our little sample here. It would be great (and probably not hard) to connect Tableau directly to a spatial database such as PostGIS or SQL Spatial. With a little more effort it should be able to connect to FME for more complex data sources or even include some licensed FME components in to the Tableau desktop.