mirror of
https://github.com/zvx-echo6/central.git
synced 2026-06-10 20:04:43 +02:00
First official-state-DOT-API pattern landing. Two adapters in one PR: - itd_511 (event-class): polls Events (60s) + Advisories (300s) from https://511.idaho.gov/api/v2/get/{event,alerts}. Decodes EncodedPolyline to LineString via the polyline lib (bookend LineString or Point fallback); ITD Severity string mapped None->1 / Minor->2 / Major->3 with IsFullClosure=true forcing 3 regardless; RecurrenceSchedules / Restrictions / DetourPolyline pass through unmodified. Advisories ship as structural pass-through under data.advisory since the upstream /alerts endpoint currently returns []; per-record try/except keeps a surprise shape from sinking the cycle when ITD posts its first one. - itd_511_cameras (telemetry-class): polls Cameras (600s). One event per camera per UTC day; image URL passes straight through to <img src>. Region uniform US-ID with data.source_jurisdiction preserving the raw upstream Source field for the ~1.2% cross-DOT border-region mirrors (UDOT / ODOT / WYDOT / WSDOT / NDot / MTD / DriveBC / Lemhi County). Subject convention (v0.9.20 forward): central.traffic.<event_type>.us.id and central.traffic_cameras.us.id.<camera_id>. Castle Rock state_511_atis keeps its bare-state subject; consumers stay on central.traffic.> wildcards during the A/B comparison window. Retry predicate tightened from the Castle Rock / TomTom precedent: 5xx + connection / timeout retry; 4xx other than 429 skip-with-warn (don't burn quota on permanent errors); 429 honors Retry-After once then retries. API key (alias 'idaho_511') travels in the ?key= query string, so every error log path runs through self._redact() to scrub the URL. Both adapters ship disabled; operator enables via GUI after registering the API key with 'python -m set_api_key idaho_511'. Reuses existing CENTRAL_TRAFFIC and CENTRAL_TRAFFIC_CAMERAS streams -- no archive restart needed. Scope-cap exception: this PR is ~1.5k lines vs. the standard 500-line cap, authorized as a one-time exception for the first official-state-DOT-API pattern landing. Two adapters + their tests + real-API fixtures naturally exceed the v0.9.x adapter-cap budget. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
214 lines
6.2 KiB
JSON
214 lines
6.2 KiB
JSON
[
|
|
{
|
|
"ID": 23,
|
|
"SourceId": "4277",
|
|
"Organization": "ERS",
|
|
"RoadwayName": "SH-81",
|
|
"DirectionOfTravel": "Unknown",
|
|
"Description": " Work on the shoulder on SH-81 near Poverty Gulch. 7/8/2024 9:29 PM Mon: 12:00 PM - 5:00 PM, Tue, Wed, Thu, Fri, Sat, Sun: Active all day Activities: use caution, warning.",
|
|
"Reported": 1720495740,
|
|
"LastUpdated": 1749675731,
|
|
"StartDate": 1720495740,
|
|
"PlannedEndDate": null,
|
|
"LanesAffected": "No Data",
|
|
"Latitude": 42.5168038430856,
|
|
"Longitude": -113.711287649613,
|
|
"LatitudeSecondary": null,
|
|
"LongitudeSecondary": null,
|
|
"EventType": "roadwork",
|
|
"EventSubType": "workOnTheShoulder",
|
|
"IsFullClosure": false,
|
|
"Severity": "None",
|
|
"Comment": null,
|
|
"EncodedPolyline": null,
|
|
"Restrictions": {
|
|
"Width": null,
|
|
"Height": null,
|
|
"Length": null,
|
|
"Weight": null,
|
|
"Speed": null
|
|
},
|
|
"DetourPolyline": "",
|
|
"DetourInstructions": "",
|
|
"Recurrence": "<b>Mon:</b><br/>12:00 PM - 5:00 PM<br/><br/><b>Tue, Wed, Thu, Fri, Sat, Sun:</b><br/>Active all day<br/><br/>",
|
|
"RecurrenceSchedules": [
|
|
{
|
|
"StartDate": "7/8/2024 9:29:00 PM-06:00:00",
|
|
"EndDate": null,
|
|
"Times": [
|
|
{
|
|
"StartTime": "12:00:00-06:00:00",
|
|
"EndTime": "16:59:59-06:00:00"
|
|
}
|
|
],
|
|
"DaysOfWeek": [
|
|
"Monday"
|
|
]
|
|
},
|
|
{
|
|
"StartDate": "7/8/2024 9:29:00 PM-06:00:00",
|
|
"EndDate": null,
|
|
"Times": [
|
|
{
|
|
"StartTime": "00:00:00-06:00:00",
|
|
"EndTime": "23:59:59-06:00:00"
|
|
}
|
|
],
|
|
"DaysOfWeek": [
|
|
"Tuesday",
|
|
"Wednesday",
|
|
"Thursday",
|
|
"Friday",
|
|
"Saturday",
|
|
"Sunday"
|
|
]
|
|
}
|
|
],
|
|
"Cause": "roadwork"
|
|
},
|
|
{
|
|
"ID": 17,
|
|
"SourceId": "469",
|
|
"Organization": "ERS",
|
|
"RoadwayName": "N McDermott Rd",
|
|
"DirectionOfTravel": "Both",
|
|
"Description": " Long term road construction on N McDermott Rd Both Directions from Five Mile Creek to US-20. All lanes closed. 1/30/2023 2:24 PM Mon, Tue, Wed, Thu, Fri, Sat, Sun: Active all day",
|
|
"Reported": 1675113840,
|
|
"LastUpdated": 1718758080,
|
|
"StartDate": 1675113840,
|
|
"PlannedEndDate": null,
|
|
"LanesAffected": "All lanes closed",
|
|
"Latitude": 43.6485700000001,
|
|
"Longitude": -116.47349,
|
|
"LatitudeSecondary": 43.6630000000001,
|
|
"LongitudeSecondary": -116.47421,
|
|
"EventType": "closures",
|
|
"EventSubType": "longTermRoadConstruction",
|
|
"IsFullClosure": true,
|
|
"Severity": "None",
|
|
"Comment": "Open to local traffic only.",
|
|
"EncodedPolyline": "qbliGhv{eUsk@MeTEsBAsAGiAQw@Qi@MoAYmA]aA]}@a@[?[JSNKNENCTEzCGnAIX",
|
|
"Restrictions": {
|
|
"Width": null,
|
|
"Height": null,
|
|
"Length": null,
|
|
"Weight": null,
|
|
"Speed": null
|
|
},
|
|
"DetourPolyline": "",
|
|
"DetourInstructions": "",
|
|
"Recurrence": "<b>Mon, Tue, Wed, Thu, Fri, Sat, Sun:</b><br/>Active all day<br/><br/>",
|
|
"RecurrenceSchedules": [
|
|
{
|
|
"StartDate": "1/30/2023 2:24:00 PM-06:00:00",
|
|
"EndDate": null,
|
|
"Times": [
|
|
{
|
|
"StartTime": "00:00:00-06:00:00",
|
|
"EndTime": "23:59:59-06:00:00"
|
|
}
|
|
],
|
|
"DaysOfWeek": [
|
|
"Monday",
|
|
"Tuesday",
|
|
"Wednesday",
|
|
"Thursday",
|
|
"Friday",
|
|
"Saturday",
|
|
"Sunday"
|
|
]
|
|
}
|
|
],
|
|
"Cause": "roadwork"
|
|
},
|
|
{
|
|
"ID": 34585,
|
|
"SourceId": "11146",
|
|
"Organization": "ERS",
|
|
"RoadwayName": "I-84",
|
|
"DirectionOfTravel": "East",
|
|
"Description": " Left Lane Blocked on I-84 Eastbound near N Franklin Blvd. 2 Left Lanes Blocked. Activities: Expect Delays, Look Out for Flagger, Use Caution.",
|
|
"Reported": 1780543740,
|
|
"LastUpdated": 1780543820,
|
|
"StartDate": 1780543740,
|
|
"PlannedEndDate": null,
|
|
"LanesAffected": "2 Left Lanes Blocked",
|
|
"Latitude": 43.5980897425697,
|
|
"Longitude": -116.542818286917,
|
|
"LatitudeSecondary": null,
|
|
"LongitudeSecondary": null,
|
|
"EventType": "accidentsAndIncidents",
|
|
"EventSubType": "leftLaneBlocked",
|
|
"IsFullClosure": false,
|
|
"Severity": "None",
|
|
"Comment": "The two left lanes of eastbound I-84 will be blocked near milepost 36.5 tonight for road maintenance. Keep Right.",
|
|
"EncodedPolyline": null,
|
|
"Restrictions": {
|
|
"Width": null,
|
|
"Height": null,
|
|
"Length": null,
|
|
"Weight": null,
|
|
"Speed": null
|
|
},
|
|
"DetourPolyline": "",
|
|
"DetourInstructions": "",
|
|
"Recurrence": "",
|
|
"RecurrenceSchedules": "",
|
|
"Cause": "Incident"
|
|
},
|
|
{
|
|
"ID": 33663,
|
|
"SourceId": "11000",
|
|
"Organization": "ERS",
|
|
"RoadwayName": "SH-16",
|
|
"DirectionOfTravel": "Both",
|
|
"Description": " Special event on SH-16 Both Directions at W Chaparral Rd. 6/8/2026 8:00 AM to 6/15/2026 5:00 PM Mon, Tue, Wed, Thu, Fri, Sat, Sun: Active all day Activities: Use Caution.",
|
|
"Reported": 1780927200,
|
|
"LastUpdated": 1779805341,
|
|
"StartDate": 1780927200,
|
|
"PlannedEndDate": 1781564400,
|
|
"LanesAffected": "No Data",
|
|
"Latitude": 43.780078841046,
|
|
"Longitude": -116.473209123902,
|
|
"LatitudeSecondary": null,
|
|
"LongitudeSecondary": null,
|
|
"EventType": "specialEvents",
|
|
"EventSubType": "specialEvent",
|
|
"IsFullClosure": false,
|
|
"Severity": "None",
|
|
"Comment": "Rodeo Traffic entering/leaving roadway ",
|
|
"EncodedPolyline": null,
|
|
"Restrictions": {
|
|
"Width": null,
|
|
"Height": null,
|
|
"Length": null,
|
|
"Weight": null,
|
|
"Speed": null
|
|
},
|
|
"DetourPolyline": "",
|
|
"DetourInstructions": "",
|
|
"Recurrence": "<b>Mon, Tue, Wed, Thu, Fri, Sat, Sun:</b><br/>Active all day<br/><br/>",
|
|
"RecurrenceSchedules": [
|
|
{
|
|
"StartDate": "6/8/2026 8:00:00 AM-06:00:00",
|
|
"EndDate": "6/15/2026 5:00:00 PM-06:00:00",
|
|
"Times": [
|
|
{
|
|
"StartTime": "00:00:00-06:00:00",
|
|
"EndTime": "23:59:59-06:00:00"
|
|
}
|
|
],
|
|
"DaysOfWeek": [
|
|
"Monday",
|
|
"Tuesday",
|
|
"Wednesday",
|
|
"Thursday",
|
|
"Friday",
|
|
"Saturday",
|
|
"Sunday"
|
|
]
|
|
}
|
|
],
|
|
"Cause": "specialEvents"
|
|
}
|
|
]
|