LFUCG released their live traffic cam map. There are more cameras on this map than in the dataset on the open data portal. There are also links to the traffic streams. This gist has the JSON data used in LFUCG’s map, a Python script for turning that JSON into more easily mapable GeoJSON, and GeoJSON of that data itself.
Make a new project directory. This example uses lex-traffic-camera
but you can use whatever you want.
Add json2geojson.py
to your directory.
Download[1] the traffic camera JSON from this gist using cURL:
curl https://gist.githubusercontent.com/maptastik/fc888b0ad9fef4ac301e9615a877b24a/raw/3a54f02d8cb17bb808f6eb126f0c1a3f5779f6dd/lfucg-live-traffic-cams.json > lfucg-live-traffic-cams.json
Run json2geojson.py
specifying the data you just downloaded as your input and specifiying the name of your outputted GeoJSON.
python json2geojson.py lfucg-live-traffic-cams.json lfucg-live-traffic-cams.geojson
Check out your output in geojson.io[2]
[1] You can also copy if from the page source. The data were stored in a variable camMarker
beginning on line 334. This might change so you may have to do some poking around the source for the data. At any rate, you can copy the contents of the camMarker
variable and use that as the JSON data to convert to GeoJSON as well.
[2] Supposedly you can use geojsonio-cli to open up this directly from the command line. I keep getting an error that the output is not valid GeoJSON although I’ve run it through linters without error. Alas…