I had an interesting question from a customer today – is it possible to use Tableau to show data that is tagged with Military Grid Reference System (MGRS) coordinates? For those unfamiliar with this system MGRS is based on the Universal Transverse Mercator (UTM) system which divides the Earth into 60 zones that are 6° of longitude wide. MGRS further divides the Earth into 20 latitude bands that are 8° high. Things get funky when you get really close to the poles (and I’m ignoring this for the purpose of this post) so the system starts with band C at 80°S and finishes at band X at 84°N. Oh – and just when you think this is a nice, neat mathematical model, they go and make some of the zones around Norway and Svalbard non-uniform so we can’t easily do this using calculations…
Using MGRS we can now reference an area of the world using the Grid Zone Designation (GZD) which is the longitude zone number followed by the latitude band letter – for example, Melbourne is in zone 55H.
These zones then subdivide further into grid squares that are 100 Km2 in size (i.e. 10Km on each side). These are identified by a two letter designation according to some complex rules but by combining the GZD with the 100 Km2 identifier we can now say that the Melbourne central business district is in 55HCU.
The zones drill down into increasingly smaller grid squares but this level will be enough for this post. Clearly, the coordinate identifiers in this model are describing an area and in Tableau we would want to use a polygon mark to represent this.
After a quick round of Google-fu I found a source of ShapeFiles for both the GZD boundaries and the 100 Km2 boundaries. The latter are very granular so I only downloaded the files required to cover Australia. As I’ve mentioned before, I use Alteryx for my quick ShapeFile -> Tableau Data Extract conversions and I have a nifty workflow (big shout out to Susan Day @ MIP who converted it into a macro for me – yay!) that outputs both the boundary vertices and the centroids so I can label the polygons if I want. The output of this process looks like this:
This gives me the data required to draw the MGRS grid. Now if I have quantitative data I want to plot (e.g. as a choropleth) I can use blending to bring the two datasets together. It’s the same technique I use in this blog post – watch the video to learn how: