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

purposeTraffic-speed data for a road segment
methodGET

Parameters

This resource supports the bbox, geography, tolerance, jurisdiction, updated, road, and area filters with the same semantics as in Event. Field selection is likely to be particular useful on this resource, as clients may want to regularly fetch current speeds without re-downloading geospatial data. 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<open511
    xml:lang="en"
    xml:base="http://my.city.gov/api/"
    xmlns:gml="http://www.opengis.net/gml"
    version="v1"
>
  <traffic_segments>  
    <traffic_segment>
        <link rel="self" href="/api/traffic_segments/my.city.gov/52" />
        <link rel="jurisdiction" href="/api/jurisdiction/my.city.gov" />
        <id>my.city.gov/52</id>
        <updated>2013-10-22T15:45:00Z</updated>
        <roads>
            <road>
                <link rel="self" href="/api/roads/my.city.gov/highway-2" />
                <name>Highway 2</name>
                <direction>N</direction>
                <from>Exit 10</from>
                <to>Exit 12</to>
            </road>
        </roads>
        <geography>
          <gml:LineString srsName="urn:ogc:def:crs:EPSG::4326">
            <gml:posList>47.33 -71.17 47.36 -71.15 47.35 -71.1 47.4 -71.2</gml:posList>
          </gml:LineString>
        </geography>
        <current_speed>30</current_speed>
        <current_travel_time>333</current_travel_time>
        <historical_speed>40</historical_speed>
        <historical_travel_time>250</historical_travel_time>
        <link rel="historical_traffic_conditions" href="/api/traffic_segments/my.city.gov/52/historical_conditions" />
        <areas>
            <area>
                <link rel="self" href="http://geonames.org/6076945/about.rdf" />
                <id>geonames.org/6076945</id>
                <name>Monte Creek</name>
            </area>
        </areas>
    </traffic_segment>
  </traffic_segments>
  <pagination>
    <offset>0</offset>
  </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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
    "traffic_segments": [
        {
            "id": "my.city.gov/52", 
            "updated": "2013-10-22T15:45:00Z", 
            "jurisdiction_url": "/api/jurisdiction/my.city.gov", 
            "url": "/api/traffic_segments/my.city.gov/52", 
            "current_travel_time": 333, 
            "current_speed": 30,
            "historical_speed": 40,
            "historical_travel_time": 250, 
            "historical_traffic_conditions_url": "/api/traffic_segments/my.city.gov/52/historical_conditions", 
            "roads": [
                {
                    "url": "/api/roads/my.city.gov/highway-2", 
                    "to": "Exit 12", 
                    "direction": "N", 
                    "from": "Exit 10", 
                    "name": "Highway 2"
                }
            ], 
            "geography": {
                "type": "LineString", 
                "coordinates": [
                    [
                        -71.17, 
                        47.33
                    ], 
                    [
                        -71.15, 
                        47.36
                    ], 
                    [
                        -71.1, 
                        47.35
                    ], 
                    [
                        -71.2, 
                        47.4
                    ]
                ]
            },
            "areas": [
                {
                    "url": "http://geonames.org/6076945/", 
                    "id": "geonames.org/6076945", 
                    "name": "Monte Creek"
                }
            ]
        }
    ], 
    "pagination": {
        "offset": 0
    }, 
    "meta": {
        "version": "v1"
    }
}

Traffic segment data structure

FieldTypeDescription
idOpen511 ID

Mandatory

A globally unique ID for the traffic segment, following the Open511 ID format.

selfLink

Mandatory

Self link to the current resource.

jurisdictionLink

Mandatory

Link to the jurisdiction publishing the traffic segment.

updatedDateTime

Mandatory

When the content of the resource last changed.

More specifically, must be the time at which the current version of this resource first became available via this Open511 API. Clients are likely to poll for changes via requests like ?updated=>2013-10-01T15:10Z where the timestamp is the last time they made such a request. Because of this, implementors need to be certain that the resource version with an updated field of 2013-10-01T15:10Z was indeed accessible to API requests at that time.

geographyGeospatial

Mandatory

Geographical coordinates for this segment. May be Point or LineString. If LineString, coordinates must be ordered properly in the direction of the road.

roadsCollection of road elements

Mandatory

Roads to which this segment belongs.

Usually a segment belongs to a single road, but the format supports multiple roads for cases where, for example, a single physical stretch of road is considered part of multiple numbered highways.

current_speedInteger

Mandatory

The speed of traffic, as of the time in updated. In km, unless the jurisdiction has set a distance_unit of MILES.

current_travel_timeInteger

Optional

The time, in seconds, to drive through this segment. (Only makes sense if geography is a LineString.)

historical_speedInteger

Optional

The usual speed for this segment at this time of the day; the exact semantics of how this number is calculated may differ between jurisdictions.

historical_travel_timeInteger

Optional

The usual time, in seconds, to drive through this segment at this time of the day.

historical_traffic_conditionsLink

Optional

A link to a list of historical traffic condition resources for this segment.

nameFree text

Optional

A descriptive name for the road segment.

areasCollections of area elements

Optional

Areas within which this segment falls.

Road structure

FieldTypeDescription
nameFree text

Mandatory

Name of the road affected by the event; should be the same as in the linked Road resource.

self / urlLink

Mandatory

Link to the Road resource for this road.

directionEnum

Mandatory

Direction of this segment. Value list:

- N
- NW
- W
- SW
- S
- SE
- E
- NE
fromFree text

Optional (mandatory if to is provided)

A description of the point on the road where the segment begins -- for example, the name of an intersecting road, or an exit number.

If no to field is provided, this field means "nearby".

toFree text

Optional

A description of the point on the road where the segment ends.