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

View file

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