Add Alaska; improve travel-iq processing; update README

This commit is contained in:
Chandler Swift 2024-02-03 01:21:58 -06:00
parent 0065c7f4f5
commit a44f8c23b6
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F
2 changed files with 69 additions and 54 deletions

View file

@ -5,58 +5,58 @@ Many states are through one of a few providers:
* Castle Rock: https://www.castlerockits.com/oneweb
* IBI Travel IQ: https://www.ibigroup.com/ibi-products/traveliq/
| State | DOT Name[^name] | Online Service Name | Video? | Web provider | Link |
| ----- | --------------- | ------------------- | ------ | ------------ | ------------------------------- |
| AK | DOT&PF | | | Travel IQ | https://511.alaska.gov/ |
| AL | ALDOT | | | | |
| AR | ARDOT | | | | |
| AZ | ADOT | | | | |
| CA | Caltrans | | | | |
| CO | CDOT | | | | |
| CT | CTDOT | | | | |
| DE | DelDOT | | | | |
| FL | FDOT | | | | |
| GA | GDOT | | | | |
| HI | HDOT | | | | |
| IA | Iowa DOT | | | | |
| ID | ITD | | | | |
| IL | IDOT | | | | |
| IN | IDOT | | | | |
| KS | KDOT | | | | |
| KY | KYTC | | | | |
| LA | DOTD | | | | |
| MA | MassDOT | | | | |
| MD | MDOT | | | | |
| ME | MaineDOT | | | | |
| MI | MDOT | | | | |
| MN | MNDOT | 511MN | most | Castle Rock | https://511mn.org/ |
| MO | MoDOT | | | | https://traveler.modot.org/map/ |
| MS | MDOT | | | | |
| MT | MDT | | | | |
| NC | NCDOT | | | | |
| ND | NDDOT | | | | |
| NE | NDOT | | | | |
| NH | NHDOT | | | | |
| NJ | NJDOT | | | | |
| NM | NMDOT | | | | |
| NV | NDOT | | | | |
| NY | NYSDOT | | | | |
| OH | ODOT | | | | |
| OK | ODOT | | | | |
| OR | ODOT | | | | |
| PA | PennDOT | | | | |
| RI | RIDOT | | | | |
| SC | SCDOT | | | | |
| SD | SDDOT | | | | |
| TN | TDOT | | | | |
| TX | TxDOT | | | | |
| UT | UDOT | | | | |
| VA | VDOT | | | | |
| VT | VTrans | | | | |
| WA | WSDOT | | | | |
| WI | WisDOT | | | | |
| WV | WVDOT | | | | |
| WY | WYDOT | | | | |
| 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/ |
| AL | ALDOT | algotraffic | 0 | 568 | custom | https://algotraffic.com/cameras |
| AR | ARDOT | | | | | |
| AZ | ADOT | | | | | |
| CA | Caltrans | | | | | |
| CO | CDOT | | | | | |
| CT | CTDOT | | | | | |
| DE | DelDOT | | | | | |
| FL | FDOT | | | | | |
| GA | GDOT | 511GA | 1 | 3416 | Travel IQ | https://511ga.org/ |
| HI | HDOT | | | | | |
| IA | Iowa DOT | | | | | |
| ID | ITD | | | | | |
| IL | IDOT | | | | | |
| IN | IDOT | | | | | |
| KS | KDOT | | | | | |
| KY | KYTC | | | | | |
| LA | DOTD | 511 | 0 | 288 | Travel IQ | https://www.511la.org/ |
| MA | MassDOT | | | | | |
| MD | MDOT | | | | | |
| ME | MaineDOT | | | | | |
| MI | MDOT | | | | | |
| MN | MNDOT | 511MN | most | | Castle Rock | https://511mn.org/ |
| MO | MoDOT | | | | | https://traveler.modot.org/map/ |
| MS | MDOT | | | | | |
| MT | MDT | | | | | |
| NC | NCDOT | | | | | |
| ND | NDDOT | | | | | |
| NE | NDOT | | | | | |
| NH | NHDOT | | | | | |
| NJ | NJDOT | | | | | |
| NM | NMDOT | | | | | |
| NV | NDOT | Nevada 511 | 0 | 606 | Travel IQ | https://www.nvroads.com/ |
| NY | NYSDOT | 511NY | 369 | 1272 | Travel IQ | https://www.511ny.org/ |
| OH | ODOT | | | | | |
| OK | ODOT | | | | | |
| OR | ODOT | | | | | |
| PA | PennDOT | | | | | |
| RI | RIDOT | | | | | |
| SC | SCDOT | | | | | |
| SD | SDDOT | | | | | |
| TN | TDOT | | | | | |
| TX | TxDOT | | | | | |
| UT | UDOT | | | | | |
| VA | VDOT | | | | | |
| VT | VTrans | | | | | |
| WA | WSDOT | | | | | |
| WI | WisDOT | 511WI | 0 | 468 | Travel IQ | https://511wi.gov/ |
| WV | WVDOT | | | | | |
| WY | WYDOT | | | | | |
[^name]: From https://en.wikipedia.org/wiki/Department_of_transportation#List_of_U.S._state_and_insular_area_departments_of_transportation

View file

@ -4,6 +4,7 @@ import requests
import json
states = {
"Alaska": "https://511.alaska.gov/",
"Georgia": "https://511ga.org/",
"Louisiana": "https://www.511la.org/",
"Nevada": "https://www.nvroads.com/",
@ -46,6 +47,9 @@ for state, baseURL in states.items():
"length": 100,
}
video_camera_count = 0
still_camera_count = 0
cameras = []
available_cameras = 999_999 # lots
@ -58,6 +62,16 @@ for state, baseURL in states.items():
res = res.json()
available_cameras = res['recordsTotal']
for c in res['data']:
if isinstance(c['videoUrl'], list): # LA returns multiple (identical?) streams
src = c['videoUrl'][0]
video_camera_count += 1
elif c['videoUrl']:
src = c['videoUrl']
video_camera_count += 1
else:
src = baseURL + "map/Cctv/" + c['id']
still_camera_count += 1
cameras.append({
"type": "Feature",
"geometry": {
@ -67,8 +81,8 @@ for state, baseURL in states.items():
"properties": {
'name': c['displayName'],
'views': [{
'hasVideo': c['videoUrl'],
'src': c['videoUrl'][0] if isinstance(c['videoUrl'], list) else c['videoUrl'], # LA returns multiple (identical?) streams
'hasVideo': bool(c['videoUrl']),
'src': src,
}],
},
})
@ -83,6 +97,7 @@ for state, baseURL in states.items():
f.write(json.dumps(geojson))
print(f"{len(cameras)} locations found for {state}")
print(f"{state}: {still_camera_count} photo + {video_camera_count} video cameras")
# hack hack hack
#