This is a draft. It may be included in Open511 in the future, but is not currently a maintained part of the specification. If you're interested in using it or participating in its development, please get in touch.

Overview

purposeAverage historical speed on a traffic segment for a particular day and time, e.g. Wednesdays at 10:30 a.m.
methodGET

Usage & Parameters

This resource is not directly accessible via discovery. URLs to this resource are provided only via links from individual traffic segment resources. A traffic segment links to a list of historical condition resources for that traffic segement. By paginating through that list, a client can get a full picture of usual conditions at several times of the day and of the week.

Alternatively, clients can provide a day (ISO weekday, from 1 to 7) and time (hh:mm) filter to request usual conditions at a specific time. The server must return the single historical condition resource nearest in time to the query. (It's very possible that the time of the returned resource won't be exactly the same as that queried by the user.) Clients must use both day and time filters, not one or the other.

Some URL parameters are common to all resources: format, version, accept-language, and limit.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<open511
    xml:lang="en"
    xml:base="http://my.city.gov/api/"
    version="v1"
>
  <historical_traffic_conditions>  
    <historical_traffic_condition>
        <link rel="traffic_segment" href="/api/traffic_segments/my.city.gov/52/" />
        <day>1</day>
        <time>00:00</time>
        <historical_speed>50</historical_speed>
    </historical_traffic_condition>
    <historical_traffic_condition>
        <link rel="traffic_segment" href="/api/traffic_segments/my.city.gov/52/" />
        <day>1</day>
        <time>00:10</time>
        <historical_speed>52</historical_speed>
    </historical_traffic_condition>
  </historical_traffic_conditions>
  <pagination>
    <offset>0</offset>
    <link rel="next" href="/api/traffic_segments/my.city.gov/52/historical_conditions/?limit=2&amp;offset=2" />
  </pagination> 
</open511>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
    "historical_traffic_conditions": [
        {
            "historical_speed": 50, 
            "traffic_segment_url": "/api/traffic_segments/my.city.gov/52/", 
            "day": 1, 
            "time": "00:00"
        }, 
        {
            "historical_speed": 52, 
            "traffic_segment_url": "/api/traffic_segments/my.city.gov/52/", 
            "day": 1, 
            "time": "00:10"
        }
    ],
    "pagination": {
        "next_url": "/api/traffic_segments/my.city.gov/52/historical_conditions/?limit=2&offset=2", 
        "offset": 0
    }, 
    "meta": {
        "version": "v1"
    } 
}

Historical traffic condition data structure

FieldTypeDescription
traffic_segmentLink

Mandatory

Link to the traffic segment this data applies to.

dayInteger, 1-7

Mandatory

The day of the week this data applies to. An ISO weekday, 1=Monday 7=Sunday.

timeTime

Mandatory

The time of day this data applies to, hh:mm.

historical_speedInteger

Mandatory

The usual speed for this segment at the given day and time. As in traffic segments.

historical_travel_timeInteger

Optional

The usual time to drive through this segment at the given day and time. As in traffic segments.