Interactive Map Open Data Information

Overview

The following data sets are available.

  • Construction Work
  • Special Events
  • Incidents
  • Traffic Cameras
  • Parking Lots
  • Park and Rides
  • Red Light Cameras

There are two ways to receive information from the Interactive Traffic Maps site.

  • Data Lists - No registration required, directly access sets of data.
  • Live Update - Registration required and limited to Construction Work, Special Events, and Incidents. When Construction, Special Events or Incidents get added/modified/deleted to and from the Interactive Traffic Map, a message will be sent to the registered web server with information about the change. This requires users to provide a URL to a server that can accept HTTP POST messages.

In both cases, the data is available in JSON format.

1. Registering

To register for real time events notifications, use the following form:

http://trafficopendata.ottawa.ca/ts/rsadmin/certificate.jsp

The URL field is optional:

  • Provide a URL to a server that can accept HTTP POST messages in order to receive the real-time updates for construction, special_events and incidents.
  • If you only want a certificate to access the City of Ottawa camera feeds, then the URL field should be left blank.

2. Live Update

JSON objects will be sent for the following events:

Incidents: An incident may be an unplanned event affecting roadways. E.g. emergency road closures, accidents, etc...

Construction / Road Work: Planned work affecting roadways.

Special Events: Other events affecting roadways. E.g. parades, protests, community events, etc...

In each case, a JSON message will be sent whenever an object is created, modified, or deleted.

2.1 Live Update Message Format

Open Data JSON Messages will consist of an object with three fields:

  • ObjectType
  • ObjectAction
  • ObjectData

ObjectType can be one of the possible values: CONSTRUCTION_EVENT, SPECIAL_EVENT, INCIDENT

ObjectAction can be one of the possible values: NEW, UPDATE, DELETE

ObjectData is the actual data for the object being submitted. It consists of the fields as described in the Message Content Format section below:

2.2 Message Content Format

Name

Type

Mandatory

Description

Id

Int

Yes

The ID of the object sent. The ID is unique to an object type (e.g. Special Events), but not across (e.g. a construction event and a special event could have the same ID).

description

String

Yes

A short description or title of the incident, construction, or event. Usually includes streets that are affected.

descriptionFrench

String

No

As description, but in French.

message

String

Yes

More detailed information

messageFrench

String

Yes

As message, but in French

latitude

Double

Yes

Latitude of the marker location for the event

longitude

Double

Yes

Longitude of the marker object for the event.

twitterMessage

String

No

A version of the message suitable for posting to twitter (i.e. <=140 characters)

twitterMessageFrench

String

No

As twitterMessage but in French

displayStartDate

Int (milliseconds since January 1, 1970, 00:00:00 GMT)

No (and not present for incidents)

(expect Incidents) The date which the message is to start being displayed. A value of null indicates it is to be displayed immediately, other values indicate the earliest date to display the message.

Note: JSON messages will not be sent prior to the start date.

displayEndDate

Int (milliseconds since January 1, 1970, 00:00:00 GMT)

No (and not present for incidents)

(expect Incidents) The date which the message is to stop being displayed; the expiry. A value of null indicates it is to be displayed until deleted, other values indicated the latest date the message should be displayed.

Note: Objects can be modified, which may affect the display end date.

Note: If an object is deleted, that takes precedence over the display end date.

2.3 Sample Messages:

{"ObjectType": "CONSTRUCTION_EVENT", "ObjectAction": "NEW", "ObjectData": {"enabled":true,"displayStartDate":null,"displayEndDate":null,"descriptionFrench":"Innes à Cyrville","twitterMessage":"Innes E/B lane reduction at Cyrville - construction.","twitterMessageFrench":"Innes d/e réduction de voies à Cyrville - construction.","message":"Innes eastbound lane reduction at Cyrville due to construction.","messageFrench":"Innes direction est réduction de voies à Cyrville en raison de construction.","id":9,"latitude":45.76,"longitude":-75.98,"description":"Innes at Cyrville"}}

{"ObjectType": "CONSTRUCTION_EVENT", "ObjectAction": "UPDATE", "ObjectData": {"enabled":true,"displayStartDate":1380600000000,"displayEndDate":1381377600000,"descriptionFrench":"Innes à Cyrville","twitterMessage":"Innes E/B lane reduction at Cyrville - construction.","twitterMessageFrench":"Innes d/e réduction de voies à Cyrville - construction.","message":"Innes eastbound lane reduction at Cyrville due to construction.","messageFrench":"Innes direction est réduction de voies à Cyrville en raison de construction.","id":9,"latitude":45.76,"longitude":-75.98,"description":"Innes at Cyrville"}}

{"ObjectType": "CONSTRUCTION_EVENT", "ObjectAction": "DELETE", "ObjectData": {"enabled":true,"displayStartDate":1380600000000,"displayEndDate":1381464000000,"descriptionFrench":"Innes à Cyrville","twitterMessage":"Innes E/B lane reduction at Cyrville - construction.","twitterMessageFrench":"Innes d/e réduction de voies à Cyrville - construction.","message":"Innes eastbound lane reduction at Cyrville due to construction.","messageFrench":"Innes direction est réduction de voies à Cyrville en raison de construction.","id":9,"latitude":45.76,"longitude":-75.98,"description":"Innes at Cyrville"}}

{"ObjectType": "INCIDENT", "ObjectAction": "NEW", "ObjectData": {"enabled":true, ,"descriptionFrench":"Bank à Wellington","twitterMessage":"Bank closed at Wellington - protest. Duration 2 hrs. ","twitterMessageFrench":"Bank fermé à Wellington - manifestation. Durée 2 hrs. ","message":"Bank closed at Wellington due to a protest. Duration is 2 hours. Avoid area and use other routes if possible.","messageFrench":"Bank fermé à Wellington en raison d\u0027une manifestation. Durée de 2 heures. Éviter secteur et utiliser autres routes si possible.","id":10,"latitude":49.0,"longitude":-75.9,"description":"Bank at Wellington"}}

{"ObjectType": "SPECIAL_EVENT", "ObjectAction": "DELETE", "ObjectData": {"enabled":true,"displayStartDate":1380600000000,"displayEndDate":null,"descriptionFrench":"Bank à Wellington","twitterMessage":"Bank closed at Wellington - protest. Duration 2 hrs. ","twitterMessageFrench":"Bank fermé à Wellington - manifestation. Durée 2 hrs. ","message":"Bank closed at Wellington due to a protest. Duration is 2 hours. Avoid area and use other routes if possible.","messageFrench":"Bank fermé à Wellington en raison d\u0027une manifestation. Durée de 2 heures. Éviter secteur et utiliser autres routes si possible.","id":10,"latitude":49.0,"longitude":-75.9,"description":"Bank at Wellington"}}

2.4 Notes and Usage:

The JSON messages are assumed to have been received at the client end.  The system will not track whether messages were successfully received nor will it resend them. With that in mind:

  • If an UPDATE message is received for an object, without a NEW message having been received, the UPDATE message should be treated as a new object.
  • If a DELETE message is received for an object, without a NEW message having been received, the DELETE message can be ignored
  • You may periodically wish to check the below URLs to retrieve a list of all events currently being displayed on the website in order to ascertain that no messages were missed on your end.

http://traffic.ottawa.ca/map/construction_list

http://traffic.ottawa.ca/map/special_event_list

http://traffic.ottawa.ca/map/incident_list

If messages are not being received correctly, please make sure that the correct URL was submitted to the Open Data site. The City of Ottawa reserves to the right to track whether certain clients have persistent submission problems and remove clients that have persistent submission problems.

3. Data Lists

The following datasets can be directly accessed from the links provided. Data is returned as a set of JSON objects.

Data Set

JSON URL

Data fields

Parking Lots

http://traffic.ottawa.ca/map/parking_list

id, description, message, messageFrench, latitude, longitude

Park and Rides

http://traffic.ottawa.ca/map/park_and_ride_list

id, description, message, messageFrench, latitude, longitude

Red Light Cameras

http://traffic.ottawa.ca/map/red_light_camera_list

id, description, message, messageFrench, latitude, longitude

Traffic Cameras

http://traffic.ottawa.ca/map/camera_list

id, description, descriptionFr, number, enabled, operatorEnabled, latitude, longitude

Incidents

http://traffic.ottawa.ca/map/incident_list

id, description, descriptionFrench, message, messageFrench, displayStartDate, displayEndDate, latitude, longitude,

Special Events

http://traffic.ottawa.ca/map/special_event_list

id, description, descriptionFrench, message, messageFrench, displayStartDate, displayEndDate, latitude, longitude, twitterMessage, twitterMessageFrench

Construction

http://traffic.ottawa.ca/map/construction_list

id, description, descriptionFrench, message, messageFrench, displayStartDate, displayEndDate, latitude,longitude, twitterMessage, twitterMessageFrench

3.1 Data Fields

The following is a description of the fields that will be present when accessing the JSON lists. See the list of data lists to see which fields are supported by which data type.

Name

Type

Description

id

Int

The ID of the object sent. The ID is unique to an object type (e.g. Special Events), but not across (e.g. a construction event and a special event could have the same ID).

description

String

A short description or title of the incident, construction, or event. Usually includes streets that are affected.

descriptionFrench

String

As description, but in French.

descriptionFr

String

As description, but in French.

message

String

More detailed information

messageFrench

String

As message, but in French

latitude

Double

Latitude of the marker location for the event

longitude

Double

Longitude of the marker object for the event.

twitterMessage

String

A version of the message suitable for posting to twitter (i.e. <=140 characters)

twitterMessageFrench

String

As twitterMessage but in French

type

String

Used to differentiate between City and MTO cameras. Values can be "CITY" or "MTO"

number

Int

Unique Camera Number

displayStartDate

Int (milliseconds since January 1, 1970, 00:00:00 GMT)

The date which the message is to start being displayed. A value of null indicates it is to be displayed immediately, other values indicate the earliest date to display the message.

Note: JSON messages will not be sent prior to the start date.

displayEndDate

Int (milliseconds since January 1, 1970, 00:00:00 GMT)

The date which the message is to stop being displayed; the expiry. A value of null indicates it is to be displayed until deleted, other values indicated the latest date the message should be displayed.

Note: Objects can be modified, which may affect the display end date.

Note: If an object is deleted, that takes precedence over the display end date.

3.2. Sample Data

Incidents:

[{"descriptionFrench":"Sussex - Bruyere à Boteler","twitterMessage":"","twitterMessageFrench":"","message":"Sussex lane reductions from Bruyere to Boteler due to construction. Duration is unknown. Expect delays.","messageFrench":"Sussex réductions de voies de Bruyere à Boteler en raison de construction. Durée est inconnue. Prévoir retards.","id":13,"latitude":45.432265,"longitude":-75.699148,"description":"Sussex - Bruyere to Boteler"}]

Parking Lots :

[{"message":"Total Capacity: 52","messageFrench":"Capacité totale: 52","id":25,"latitude":45.417527,"longitude":-75.699194,"description":"212 Gloucester"},{"message":"Total Capacity: 293","messageFrench":"Capacité totale: 293","id":26,"latitude":45.428813,"longitude":-75.693457,"description":"70 Clarence"},{"message":"Total Capacity: 453","messageFrench":"Capacité totale: 453","id":27,"latitude":45.429892,"longitude":-75.69133,"description":"141 Clarence "}]