Skip to main content

On the Records: A View Behind the Cameras

How we built the red-light camera app. Download the data and build your own — or embed ours as an iframe.

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

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.

Texans need truth. Help us report it.

Yes, I'll donate today

Explore related story topics

Courts Criminal justice Transportation Public Information Act Texas Department Of Transportation