Refactor DOT cam layers; misc features

* Add more travel-iq states
 * Combine DOT cam layer UI into single place
 * Use standard schema for cam data
 * Differentiate between photo and video cameras
This commit is contained in:
Chandler Swift 2024-01-31 01:17:04 -06:00
parent 710930f428
commit dbcd151364
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F
16 changed files with 324 additions and 276 deletions

View file

@ -3,8 +3,13 @@
import requests
import json
with open('states.json') as f:
states = json.loads(f.read())
states = {
"Georgia": "https://511ga.org/",
"Louisiana": "https://www.511la.org/",
"Nevada": "https://www.nvroads.com/",
"NewYork": "https://www.511ny.org/",
"Wisconsin": "https://511wi.gov/"
}
for state, baseURL in states.items():
query={
@ -60,9 +65,11 @@ for state, baseURL in states.items():
"coordinates": [c['longitude'], c['latitude']], # yes, [lon, lat] since it's [x, y]
},
"properties": {
'address': c['displayName'],
'website': c['videoUrl'],
'originalData': c,
'name': c['displayName'],
'views': [{
'hasVideo': c['videoUrl'],
'src': c['videoUrl'][0] if isinstance(c['videoUrl'], list) else c['videoUrl'], # LA returns multiple (identical?) streams
}],
},
})
query['start'] += 100