With the latest release, 2021.2, Tableau continues to add more geospatial functionality. The Area function “returns the total surface area of a spatial polygon” and allows you to specify the unit of measurement for the area to be returned in: metres, kilometres, miles or feet.
This blog and workbook provide a few sample use cases and a note of caution regarding polygon accuracy.
Update: If you prefer a video format, I’ve now created a video tutorial that steps through some examples of how to use Tableau’s Area function, including creating area calculations with acres and hectares:
Area of London Boroughs
In this example, I connected to a shapefile containing polygons for each of the London boroughs and then use the following calculation to return the area of each polygon in square miles, which was then used to colour the map:
Creating Charts from the Area Calculation
Now we have this new measure – the Area of each borough – this can be used like any other measure in our data to create charts, such as a bar chart showing the top 10 largest boroughs:
London Parks in Acres
From the four units that can be used with the function, other units can be calculated such as acres or hectares. Below, I’ve connected to another spatial file containing polygons of parks in central London and used the following calculation to return the area of each polygon in hectares – there are 640 acres in a square mile:
AREA([Geometry],"mi") * 640
Again, we can use the newly calculated Area measure to create charts and graphs such as these:
It’s important to be aware that the accuracy of the Area calculation is dependent on the accuracy of the polygon being used. For example, below I’ve calculated the area of Monaco based on the polygon for Monaco, with a result of 18.8 sq. km. However, the actual area of Monaco is much smaller (about 2.1 sq. km.) as can be seen from the map under the polygon.
Therefore, it’s wise to double check some of your area calculations against another source if you have one and/or visibly check the accuracy of the polygons of the spatial file you are using by viewing them on a map to see how they line up with the underlying map, though this will only be possible if the map contains the same geometry outline as the polygon itself.
Something else to be mindful of is the complexity of the polygon and also the size of the polygon. The Area calculation does not take into account the curvature of the earth so if you are using a polygon that covers a large area such as a large country there may be some variance between the exact area of the country and the value returned from the function. Tableau Zen Master Tim Ngwena recently shared a video on the Area function and touches on these topics so I recommend watching that to learn more.
It’s great to see Tableau continue to develop more spatial features in the product. The ability to combine these spatial functions – MakeLine, MakePoint, Distance etc. – and now Area, really opens up more opportunities for geospatial analysis.
The workbook including the shapefiles used above can be downloaded here.
Thanks for reading!
Latest YouTube video
This video tutorial steps through how to create a dot plot in Tableau.
Leave a Reply