Monday, July 13, 2015

KC Traffic Data: Speed Sensors

Recently I started capturing data from the Speed Sensors of the KC Scout system here in the KC Metro detailed in this post. So I am collecting tons of data from the Speed Sensors daily (archive table has over 9 million rows already)  and I started to wonder what I should do with all that data.


Why not build a heat map for day of week and hour of day? Having no good answer to that question I threw together a quick website that allows you to select a Speed Sensor and then generate a Heat Map for that speed sensor.

Since I was in a hurry I did not get fancy with the selector:

Here you get a big ol list of Speed Sensors with cryptic names and such. One future feature I want to implement is to plot all the sensors on a Google Map and let you select a Sensor from the map to generate the HEAT MAP.

After you Select a sensor and click Generate you land here:

This will give you a map of where the sensor is located and the average speed for each day of the week and each hour of the day in a sweet looking heat map. I am using the sweet Library to build the Heat Map.

Like most of my stuff this is pretty bush league. I am actually building a Tab Separated Values file on the fly and using that to source the Heat Map. Therefore its pretty slow and I cannot send out the link to folks cause it will not be able to handle multiple requests very well.

I need to spend some time to figure out how to make the D3js heat map hit the database directly but as typical with my stuff I just crank it out and figure out the details later.

End of Post update 

So while composing this blog I decided to stop being lazy and work on the Maps idea I mentioned above. Here is a screenshot of the map:

Now you can select a sensor from the map and then link to the Heat Map. Pretty Boss. Anyway yeah I think the next step is to figure out how to dynamically build the Heat Map using D3 hitting the database directly. Hopefully I can figure that out eventually.


Post a Comment