The nightmare .CSV file generated from TxDOT's PDFs.
The nightmare .CSV file generated from TxDOT's PDFs. Matt Stiles

Our latest data application, which lets you explore red-light cameras around the state, began last week as 363 files in portable document format.

You remember how much we like those, right?

That’s the format in which the Texas Department of Transportation collected data on citations and crashes at monitored intersections. Fortunately, though, we were able to extract the data to a .CSV format (see the original here) and then massage that file into something suitable for the app.

Niran, one of our Python wizards, wrote a script and used the Google Maps API to geocode, or assign longitude and latitude coordinates, to each intersection. That gave us precise locations for about two thirds of the camera sites, but the rest had to be added manually. He then loaded the list into our database and used Django to build pages to display the data. Embedded Google Maps with our longitudes and latitudes create the visualizations of each intersection.

Not everyone is a developer, of course, so we’ve made the application embeddable as an iframe. Here’s what it would like zoomed in on Houston, for example:

Let us know if you need help with the code.

Texas Tribune donors or members may be quoted or mentioned in our stories, or may be the subject of them. For a complete list of contributors, click here.

Matt Stiles covered government and politics for the Tribune, with a focus on data journalism, from 2009 to 2011. He oversaw and developed the Tribune’s library of web applications and interactive graphics....

Niran Babalola was a software engineer and technology director at The Texas Tribune, where he worked from 2009 to 2012. Previously he wrote web applications for the Austin American-Statesman. He has also...