Add more Travel IQ dot cam states

main
Chandler Swift 2024-02-03 03:01:05 -06:00
parent c125525413
commit 8f5803b5bc
Signed by: chandlerswift
GPG Key ID: A851D929D52FB93F
2 changed files with 76 additions and 68 deletions

View File

@ -5,21 +5,23 @@ Many states are through one of a few providers:
* Castle Rock: https://www.castlerockits.com/oneweb * Castle Rock: https://www.castlerockits.com/oneweb
* IBI Travel IQ: https://www.ibigroup.com/ibi-products/traveliq/ * IBI Travel IQ: https://www.ibigroup.com/ibi-products/traveliq/
### State list
| State | DOT Name[^name] | Online Service Name | Still | Video | Web provider | Link | | State | DOT Name[^name] | Online Service Name | Still | Video | Web provider | Link |
| ----- | --------------- | ------------------- | ----- | ----- | ------------ | ------------------------------- | | ----- | --------------- | ------------------- | ----- | ----- | ------------ | --------------------------------- |
| AK | DOT&PF | Alaska 511 | 111 | 0 | Travel IQ | https://511.alaska.gov/ | | AK | DOT&PF | Alaska 511 | 111 | 0 | Travel IQ | https://511.alaska.gov/ |
| AL | ALDOT | algotraffic | 0 | 568 | custom | https://algotraffic.com/cameras | | AL | ALDOT | algotraffic | 0 | 568 | custom | https://algotraffic.com/cameras |
| AR | ARDOT | | | | | | | AR | ARDOT | | | | | |
| AZ | ADOT | | | | | | | AZ | ADOT | AZ511 | 602 | 0 | Travel IQ | https://az511.com/ |
| CA | Caltrans | | | | | | | CA | Caltrans | | | | | |
| CO | CDOT | COtrip | 832 | 686 | Castle Rock | https://maps.cotrip.org/ | | CO | CDOT | COtrip | 832 | 686 | Castle Rock | https://maps.cotrip.org/ |
| CT | CTDOT | | | | | | | CT | CTDOT | CTroads | 350 | 0 | Travel IQ | https://ctroads.org/ |
| DE | DelDOT | | | | | | | DE | DelDOT | | | | | |
| FL | FDOT | | | | | | | FL | FDOT | | | | | |
| GA | GDOT | 511GA | 1 | 3416 | Travel IQ | https://511ga.org/ | | GA | GDOT | 511GA | 1 | 3416 | Travel IQ | https://511ga.org/ |
| HI | HDOT | | | | | | | HI | HDOT | | | | | |
| IA | Iowa DOT | 511IA | 446 | 485 | Castle Rock | https://511ia.org/ | | IA | Iowa DOT | 511IA | 446 | 485 | Castle Rock | https://511ia.org/ |
| ID | ITD | | | | | | | ID | ITD | Idaho 511 | 274 | 0 | Travel IQ | https://511.idaho.gov/ |
| IL | IDOT | | | | | | | IL | IDOT | | | | | |
| IN | IDOT | TrafficWise | 0 | 640 | Castle Rock | https://511in.org/ | | IN | IDOT | TrafficWise | 0 | 640 | Castle Rock | https://511in.org/ |
| KS | KDOT | KanDrive | 382 | 167 | Castle Rock | https://www.kandrive.gov/ | | KS | KDOT | KanDrive | 382 | 167 | Castle Rock | https://www.kandrive.gov/ |
@ -50,7 +52,7 @@ Many states are through one of a few providers:
| SD | SDDOT | | | | | | | SD | SDDOT | | | | | |
| TN | TDOT | | | | | | | TN | TDOT | | | | | |
| TX | TxDOT | | | | | | | TX | TxDOT | | | | | |
| UT | UDOT | | | | | | | UT | UDOT | UDOT Traffic | 0 | 1787 | Travel IQ | https://www.udottraffic.utah.gov/ |
| VA | VDOT | | | | | | | VA | VDOT | | | | | |
| VT | VTrans | | | | | | | VT | VTrans | | | | | |
| WA | WSDOT | | | | | | | WA | WSDOT | | | | | |
@ -62,7 +64,12 @@ Many states are through one of a few providers:
[^name]: From https://en.wikipedia.org/wiki/Department_of_transportation#List_of_U.S._state_and_insular_area_departments_of_transportation [^name]: From https://en.wikipedia.org/wiki/Department_of_transportation#List_of_U.S._state_and_insular_area_departments_of_transportation
### Non-State aligned
* New England 511 (https://newengland511.org/) consolidates Maine, New Hampshire, and Vermont into one site (341 photo/0 video/Travel IQ)
### Notes
https://map.wyoroad.info/wtimap/index.html https://map.wyoroad.info/wtimap/index.html
@ -128,14 +135,5 @@ https://dot.ca.gov/programs/traffic-operations/traveler-information/511
"rr": "https://riverregion511.org" castlerock "rr": "https://riverregion511.org" castlerock
No video, only photos ??
"ak": "https://511.alaska.gov/",
"az": "https://az511.com/",
"ct": "https://ctroads.org/",
"new england": "https://newengland511.org/",
"id": "https://511.idaho.gov/",
"ut": "https://www.udottraffic.utah.gov/",
Some kind of signature needed: Some kind of signature needed:
"fl": "https://fl511.com/", "fl": "https://fl511.com/",

View File

@ -5,10 +5,15 @@ import json
states = { states = {
"Alaska": "https://511.alaska.gov/", "Alaska": "https://511.alaska.gov/",
"Arizona": "https://az511.com/",
"Connecticut": "https://ctroads.org/",
"Georgia": "https://511ga.org/", "Georgia": "https://511ga.org/",
"Idaho": "https://511.idaho.gov/",
"Louisiana": "https://www.511la.org/", "Louisiana": "https://www.511la.org/",
"Nevada": "https://www.nvroads.com/", "Nevada": "https://www.nvroads.com/",
"NewEngland": "https://newengland511.org/",
"NewYork": "https://www.511ny.org/", "NewYork": "https://www.511ny.org/",
"Utah": "https://www.udottraffic.utah.gov/",
"Wisconsin": "https://511wi.gov/" "Wisconsin": "https://511wi.gov/"
} }
@ -54,6 +59,10 @@ for state, baseURL in states.items():
available_cameras = 999_999 # lots available_cameras = 999_999 # lots
while len(cameras) < available_cameras: while len(cameras) < available_cameras:
if state == "Connecticut":
# gotta be a special snowflake I guess?
res = requests.post(f"{baseURL}/List/GetData/Cameras", json={"draw":1,"columns":[{"data":"sortId","name":"sortId","searchable":True,"orderable":True,"search":{"value":"","regex":False}},{"data":"cityName","name":"cityName","searchable":True,"orderable":True,"search":{"value":"","regex":False}},{"data":"roadway","name":"roadway","searchable":True,"orderable":True,"search":{"value":"","regex":False}},{"data":"sortIdDisplay","name":"sortIdDisplay","searchable":True,"orderable":True,"search":{"value":"","regex":False}},{"data":"description1","name":"description1","searchable":False,"orderable":True,"search":{"value":"","regex":False}},{"data":"direction","name":"direction","searchable":False,"orderable":False,"search":{"value":"","regex":False}},{"data":6,"name":"","searchable":False,"orderable":False,"search":{"value":"","regex":False}}],"order":[{"column":0,"dir":"asc"},{"column":1,"dir":"asc"}],"start":0,"length":10,"search":{"value":"","regex":False}})
else:
res = requests.get(f"{baseURL}/List/GetData/Cameras", { res = requests.get(f"{baseURL}/List/GetData/Cameras", {
"query": json.dumps(query), "query": json.dumps(query),
"lang": "en", "lang": "en",
@ -62,10 +71,11 @@ for state, baseURL in states.items():
res = res.json() res = res.json()
available_cameras = res['recordsTotal'] available_cameras = res['recordsTotal']
for c in res['data']: for c in res['data']:
if isinstance(c['videoUrl'], list): # LA returns multiple (identical?) streams if 'videoUrl' in c and isinstance(c['videoUrl'], list): # LA returns multiple (identical?) streams
src = c['videoUrl'][0] src = c['videoUrl'][0]
video_camera_count += 1 video_camera_count += 1
elif c['videoUrl']: elif 'videoUrl' in c and c['videoUrl'] and c['videoUrl'] != '0':
# Yeah, Idaho has a single camera where videoURL = '0'. Nice.
src = c['videoUrl'] src = c['videoUrl']
video_camera_count += 1 video_camera_count += 1
else: else:
@ -81,7 +91,7 @@ for state, baseURL in states.items():
"properties": { "properties": {
'name': c['displayName'], 'name': c['displayName'],
'views': [{ 'views': [{
'hasVideo': bool(c['videoUrl']), 'hasVideo': 'videoUrl' in c and bool(c['videoUrl']),
'src': src, 'src': src,
}], }],
}, },