What is this site?
This site is just a little experiment in Web 2.0 mashups. Starting with an XML feed of state-wide traffic incidents from the California Highway Patrol at http://media.chp.ca.gov/sa_xml/sa.xml we pull out local incidents and build on them.
Hopfully the result is something useful.
What can I see here?
First we display local incidents and their details then we map them using Google Maps. We try to use the location information included in the incident but if it's not their, we'll geocode it manually.
Area-wide advisories and media alerts will also be displayed "banner-style" across the top of the site.
Then we add Google's support for traffic condition overlays so you can see at-a-glance area traffic conditions.
We also provide an RSS feed of all the active incidents that is customizable to show specific streets or even a set of streets. You can customize it to, say, your commute streets and get updates of traffic incidents along your commute while at work.
But wait, there's more! There's a Twitter feed as well. You can get updates virtually live as they come in. Using the Twitter 'track' feature you can get traffic updates for the street or freeway of your choice as well.
We also have live video from both Cal Trans and the Department of Transportation too. Now you can see traffic too.
Can I build on your work?
Of course! The JSON data for every CHP Dispatch in California is located here: http://www.sactraffic.org/json/. The filename is based on the CHP "center" and "dispatch" so http://www.sactraffic.org/json/STCC-STCC.json would be the data for the Sacramento area.
The JSON format looks like:
[
{
Area: "North Sacramento"
ID: "0787D1101"
Location: "MADISON AV at HACKBERRY LN"
LogDetails: {
details: [
{
DetailTime: "9:18AM"
IncidentDetail: "BLU FORD EXP VS SIL TOYT SD"
}
],
units: [
{
DetailTime: "\" 9:23AM\""
IncidentDetail: "\"CHP Unit Enroute\""
}
],
}
LogTime: "11/1/2009 9:18:48 AM"
LogTimeEpoch: "1257095928"
LogType: "Collision - Non Injury"
LogTypeId: "1182"
Status: "active",
TBXY: "6752401:2003123"
ThomasBrothers: "259 7C"
}
]
I also have a JSONP hook set up through http://www.sactraffic.org/jsonp.php. Simply pass a callback and a dispatch argument and go nuts.
Here's a jQuery example:
$.getJSON("http://www.sactraffic.org/jsonp.php?dispatch=STCC-STCC&callback=?",
function(data){
// do stuff...
});
});
Feel free to use them as you see fit. If you do, let me know if you come up with something cool.
You can be reached where?
My email address is "sactraffic" at this domain.
What's next?
I dunno. Perhaps an alert setup for CHP "sigalerts"? More cameras? I'd like to get real graphic icons for the various incident types to display on the map.