Wednesday, February 18, 2015

Visualization: Melbourne Truck AADT Map (2012)

Yesterday I had a discussion with one of my colleagues, Colin Caprani who is a lecturer in the Civil Engineering Department at Monash University on a potential collaboration. Colin is in the structure group. His research specialization includes bridge traffic loading and ITS-infrastructure interaction.

The following visualization is a result of our conversation plus a couple of my hours today. I spent about an hour to find and process the data and a good few more hours to visualize it in CartoDB. What I see in the map is a clear larger truck volumes on freeways, around the Port of Melbourne, and Essendon airport. I could also identify a few other truck corridors in Melbourne such as the Princess Highway, Nepean Highway, Bell Street, etc. Perhaps a more comprehensive analysis could reveal more insightful patterns and findings.

Link to the map:

At first, I was trying to develop a heatmap showing the spatial distribution of truck volumes as an indication of where road damages are more likely to occur. I used "Torque Heat" which is a combination of heatmaps and Torque in CartoDB but I struggled. 

The default torque-aggregation-function in torque heat is count(cartodb_id). Since we wanted to visualize where truck volumes are higher, I changed the function to (round(avg(trucks)). But it didn't work as I expected. See the code below. It took me a few hours to figure out why. The problem was not with the aggregation function; rather, it was the image-filters: colorize-alpha () which caused a confusion. Apparently the colorize-alpha() filter only works with count data. According to its developer website, "Colorize-alpha is an image-filter and works at the layer level. Technically, we accumulate alpha channel values from densely positioned markers and convert this value to the color."

Well, I ended up using a bubble chart which is as informative but simpler to implement. If I figure out how to fix the image-filtering problem, I'll update the map.

CartCSS code for the Heatmap (which didn't give me what I wanted)
/** torque_heat visualization */
Map {
  image-filters: colorize-alpha(blue, cyan, lightgreen, yellow , orange, red);
  marker-file: url(;
  marker-fill-opacity: 0.4;
  marker-width: 35;
#truck_data_2012_updated[frame-offset=1] {
#truck_data_2012_updated[frame-offset=2] {

No comments:

Post a Comment