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:
parent
710930f428
commit
dbcd151364
16 changed files with 324 additions and 276 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue