-
Notifications
You must be signed in to change notification settings - Fork 3
Feed format
Incidents (traffic accidents and collisions) are different enough from Road Closures (due to special events, road construction, or highway construction) that they deserve different feeds. However, they are combined into an Alert feed, useful for constructing a single map or summary page.
Here's the proposed sitemap of the pages for end-users:
-
/
- Map of all alerts (incidents and closures), links to sub-pages. Synonyms are/index.html
,alerts.html
. -
/alerts/incidents.html
- A map of traffic incidents -
/alerts/incident/in100.html
- A map of incident #100 -
/alerts/closures.html
- A map of road and highway closures -
/alerts/closure/cl78.html
- A map of closure #78
For developers, there are variants of the pages. For page.html
, there is also:
-
page.dev.html
- A page describing variants and filtering options -
page.xml
- An Atom-formatted feed -
page.json
- A JSON-formatted
For developers, there are versioned APIs as well. /versions.html
lists the different versions available. /version/v1/alerts.json
would be the version 1 variant of the alerts JSON. The current version is duplicated at /alerts.json
.
The Atom feeds could be used for subscribing to data type. The format depends on the data type.
The incidents feed is located at /alerts/incidents.xml
. Here is a sample:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:georss="http://www.georss.org/georss">
<id>tag:trif.tulsawebdevs.org,2011-10-07,3</id>
<title>Tulsa Road Accidents</title>
<subtitle>Road Accidents in Tulsa, OK</subtitle>
<link href="http://trif.tulsawebdevs.org/incidents.xml" rel="self"/>
<updated>2011-10-03T17:43:32.216-05:00</updated>
<author>
<name>Tulsa Web Devs</name>
<uri>http://tulsawebdevs.org</uri>
</author>
<entry>
<id>tag:trif.tulsawebdevs.org,2011-10-07,3:incident/in101</id>
<title>Non-Injury Collision at 6500 S HWY75 SB/ INVOLVED</title>
<updated>2011-10-03T21:48:44.0-05:00</updated>
<summary>Non-Injury Accident at 6500 S HWY75 SB/ INVOLVED</summary>
<category term="type:incident" label="Incident" />
<category term="incident_type:Non-Injury" label="Non-Injury" />
<category term="incident_road_type:highway" label="Highway" />
<category term="incident_highway:75" label="Highway 75" />
<category term="incident_road_direction:SB" label="South-Bound" />
<published>2011-10-03T21:48:44.0-05:00</published>
<georss:point>36.0621788 -95.8600714</georss:point>
<link href="http://trif.tulsawebdevs.org/incident/in101.html" rel="self"/>
<link href="http://www.cityoftulsa.org/live-traffic-report.aspx" rel="via"/>
<content type="html">
<dl>
<dt>Type:</dt>
<dd>Non-Injury</dd>
<dt>Description:</dt>
<dd>NON-INJURY COLLISION</dd>
<dt>Date:</dt>
<dd>10/03/11</dd>
<dt>Time:</dt>
<dd>9:48:44 PM</dd>
<dt>Location:</dt>
<dd>6500 S HWY75SB/ INVOLVED</dd>
<dt>Number:</dt>
<dd>1</dd>
</dl>
</content>
</entry>
The feed is derived from data parsed from http://cityoftulsa.org/rss/accident.aspx. If time allows, an attempt is made to trace an incident as data changes. In this case, the <updated>
time is changed, but the incident ID (in101
in this case) stays the same. The content is the <Incident>
XML element and children, converted to an HTML definition list.
The <category>
elements are nice-to-haves. The City of Tulsa description is parsed, and different terms are populated.
The <georss:point>
is the pin location for the map.
TODO: list options to filter incidents
TODO: specify, add sample, notes, options
The Alerts feed combines the Incidents and Closures feeds. Here is a sample:
TODO: add sample
TODO: Specify JSON feeds