Tableau How To: Viz of DC Crime, Transit and Imagery | Urban Mapping Blog
At last month’s Tableau Customer Conference in Washington D.C., we ran a hands-on mapping session that showed how to create dual axis maps while retaining two measures, build custom regions, create a viz with open data and how to use additional data and services from Urban Mapping, Tableau’s official map provider, through Mapfluence, our mapping platform.
Because Mapfluence has a direct connection into Tableau that does an end-around WMS, high resolution imagery can be seamlessly integrated into Tableau, tiling only the portions of the image you need as a base layer under your viz. Any data viz guru will tell you that unnecessary levels of detail clutter your presentation and obscure your message, which is why it is better to avoid a complicated base map where a simpler one will do. Nevertheless, there are cases where high resolution imagery provides valuable context for your viz. For example, if you want to show parcel boundaries or building outlines in their spatial context, the benefits are obvious:
The above map is rendered by Mapfluence. It can display, customize and symbolize the features in the variety of ways you would style a filled map without any limitations on rendering boundaries. When you draw your filled map directly onto the base map, you are free to use all of your dimensions to visualize data.
With a little geospatial wizardry, you are not limited to the dimensions and measures associated with the geometries you are drawing. Using Mapfluence or geospatial software like QGIS, you can aggregate point level data to your custom geographic boundaries to create new dimensions and measures.
For the Tableau Customer Conference, we thought it would be fun to show off some data that was relevant to Washington D.C. After stumbling when trying to use open data describing restaurant health code violations (be sure to read the companion cautionary tale of open data), we found the District of Columbia produces good quality, up-to-date data on crime incidents since 2011.
Building The Viz
The source data contains location information (latitude-longitude pairs) and several associated attributes (crime type, description, etc). To maintain privacy, incidents are geocoded to the nearest block instead of the actual address, so on a map the points appear as a gridded mass of dots.
You could generate a kernel density estimation based on the point distribution (i.e. a heat map), however this masks the aggregation at block level, and could give your audience false impressions about the patterns in your data. Furthermore, we want to get a sense of overall crime rates throughout the city. Kernel density estimates are more useful for hot spot analyses of particular types of crime, and when you have an actual, non-aggregated location. When looking at crime rates overall, or any complicated and varied phenomenon, kernel densities are difficult to interpret:
When you aggregate points by census block, you are presenting the underlying data at its appropriate level of aggregation. As we can see, patterns emerge.
While the high resolution imagery allows us to see context block by block, it also complicates the viz. To show both, I varied the transparency with number of incidents by block instead of using a color ramp. That way, you can see where the greatest number of incidents were reported, but you also see as much of the underlying imagery as possible for the additional context of roads, buildings, and other geographic markers. Finally, we wanted to introduce another dimension to the viz. Because Mapfluence contains over 10,000 on-demand variables in our data catalog, we decided to overlay line and station information for the DC Metro subway system. This allows for anther dimension in the analysis.
To overcome some of the limitations in how Tableau deals with geographic polygons, we render and serve the census blocks from Mapfluence. This is effective as Mapfluence is designed as a web-based GIS and geographic analysis and representation is second nature to us. However, this is also not ideal as Tableau users like to play with all the data they can.
Working with Leigh Fonseca of Fonseca Data Science, we came to a very subtle but compelling solution: leave the heavy geo-lifting to Mapfluence, and allow Tableau to act as the reporting tool. In this way, the polygons act as a proxy for the underlying points that are available in the workbook, a la tooltip functionality! Importing data into Tableau allows users to create a dashboard on top of a custom base map that you can filter according to the underlying points.
Click the image above to explore the dashboard. You can click individual blocks or select an area to see a breakdown of the crime types compared to crime citywide. Crime definitions are explained here.
Although we do not purport to be criminologists, this viz highlights data that would be impossible to see in a spreadsheet. Here are some things we observed:
- Theft of property represents a very disproportionate number of the highest density of incidents near the Columbia Heights Metro Station (14th Street NW and Irving): 533 out of 554 reported incidents.
- Car break-ins represent a greater proportion of incidents on the outskirts of DC than in the city center.
- There are approximately half as many burglaries in Northwest as compared to Southeast or Northeast.
- Relatively few crime incidents were reported on the Washington DC Mall compared to the city overall between January, 2011 and August, 2013: 45 thefts, plus 22 car break-ins, 6 robberies, 5 car thefts, 3 assaults with weapons, and 2 sex crimes.
There are plenty of additional ways to drill down into this data for the inquisitive data nerds out there. You could normalize by population per census block to see which crimes occur more frequently were the residential population is higher or lower. You could focus on visualizing the spatial patterns of a particular type of crime or set of crimes. Or you could visualize the changes in crime patterns over time using a time slider.
At Urban Mapping we’re excited about Tableau, and we’re excited about mapping in Tableau, and we suspect you are as well. We’ve taken a moment to showcase high resolution imagery in Tableau, and the potential for using data + mapping in Mapfluence to build dashboards in Tableau for exploring geographic phenomena. Please let us know what you think and be sure to learn more about our enhanced mapping solutions for Tableau.
Leave a Comment
You must be logged in to post a comment.