Vishful thinking…

TableauShapeMaker – Adding custom shapes to Tableau maps

Posted in Uncategorized by viswaug on June 29, 2015

Hello fellow map herders, I recently wrote this little utility that can convert shapefiles into a CSV format that is consumable by Tableau. Tableau has a collection of built-in shapes that are sufficient for most mapping needs inside Tableau. But sometimes, there are valid reasons for wanting to add custom lines or polygons on to the Tableau map. This utility processes a shapefile in any coordinate system and optionally simplifies the shapes to reduce the number of vertices being displayed and outputs a CSV file that can be consumed by Tableau and blended with other data sets to produce the required visualization.

-h, -?, –help Show this message and exits
-i, –input=VALUE (Required) Input shape file in any geographic or projected coordinate system
-o, –output=VALUE (Optional) Output CSV file name
-t, –tolerance=VALUE (Optional) Tolerance value to use for simplifying the shape.

Example command

TableauShapeMaker.exe -i “C:\VA_JURIS.shp” -o juris.csv -t 0.001

The utility can handle displaying multi-part polygon/line shapes like the Hawaiian islands properly. But the utility cannot handle converting holes in polygons. This is due to the fact that I could not find information on how to represent them in the Tableau format. If anyone can help me with the representation for holes, I can add that feature to the utility also.

To display the shapes in the generated CSV file on the Tableau maps, add the CSV file as a data source in Tableau. The “Latitude” and “Longitude” fields should be identified as “Measures”, if not please mark them as such. The “Point ID”, “Polygon ID” and “Sub Polygon ID” fields should be identified as “Dimensions”. Double click the “Latitude” and “Longitude” measures to add them into the row and column shelves. Select “Polygon” from the “Marks” drop down. Drag the “Point ID” dimension to the “Path” shelf followed by the “Polygon ID” dimension to the “Detail” shelf and the “Sub Polygon ID” dimension to the “Detail” shelf. This should display the shapes on the map. To color the shapes by a certain dimension, say “Name”, drag the “Name” dimension to the “Color” shelf.

Since, holes are not supported by TableauShapeMaker, you will need to ensure that the smaller shapes are on top of the larger shapes ONLY IF they can be on top of each other. The shapes drawing order can be controlled/rearranged by dragging their legend entries to the right position in the legend list.

Obligatory screenshot…


Download TableauShapeMaker


6 Responses

Subscribe to comments with RSS.

  1. L said, on July 9, 2015 at 9:12 pm

    The download link goes no where

    • viswaug said, on July 9, 2015 at 11:56 pm

      Seems to work fine for me. Let me know if you are still having problems downloading, I can just email it to you.

  2. Tausif Farooqui said, on November 4, 2015 at 9:50 am

    Very useful utility! Thanks for creating this.

  3. Nathan Smtuz said, on November 24, 2015 at 9:45 pm

    I got the utility to work (Windows 7 64-bit) by copying the contents of ./gdal/x64 into the folder with TableauxShapeMaker.exe

  4. Mag Salazar said, on December 23, 2015 at 10:31 am

    Hi, This looks great, but can’t install it, even after trying Nathan’s tip… Any help much appreciated!

    • viswaug said, on December 23, 2015 at 1:30 pm

      There is no install. You will have to just run it from the commandline. If you are getting an error, can you please post the error message?

Leave a Reply

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

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

Facebook photo

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

Connecting to %s

%d bloggers like this: