Skip to content

Functionality Overview

Steven Ottens edited this page Oct 7, 2016 · 55 revisions

User Management

Three levels of users exist.

User: Users can view data within the Open Traffic UI, save and share routes, and export non-sensitive data via CSV.

Admin: Admins have all the rights of Users, however Admins can also view sensitive data via the CSV export. Specifically, Admins have the ability to view vehicle count data.

Super Admin: Super admins have all the rights of Admins, however, Super Admins can also add/edit/delete users.

To edit or delete users, login as a super admin and go to "View Users" from the Welcome menu.

To create new users, login as a supser admin and got o "Create Users" from the Welcome menu.

Login and Select your Country

The landing page for Open Traffic will prompt for a Username, Password, and City.

Select the specific city that you are studying will preload the map and traffic data for that city.

Planning a Route

After logging in, you are brought to the Routing tab.

To plot a route,

  1. Click once on the map to select an origin.

  2. Click a second time on the map to select a destination.

OpenTripPlanner is used determine the fastest route between these two points.

  1. Optional: Each additional click on the map will add an additional point to the end of the route.

After each point is placed the route is updated with the average speed for each segment and the traffic data for the additional segments are added to the bar chart.

Removing a point To remove a point, click it again. To remove the most recent point, click the undo arrow in the top-right of the map.

Reseting a route Click 'Reset Route' to erase all points and start planning a new route.

Planning a Route by Time of Day

By default, the route selected by OpenTripPlanner between two points uses traffic data from all available weeks along that segment.

However, it it may be useful to view routes for a specific day and hour.

To do this:

  1. Select 'Show Fastest Route by Day and Hour'

  2. On the Day and Hour picker, choose the day of the week and the specific hour that you wish to study.

After selecting the day and hour, you will be returned to the map and the route will be updated so that the route taken will use traffic data from the specific day and hour chosen.

The route chosen represents the fastest route between the selected points for a specific day and hour, however, you are still able to view traffic data for the segments along the route for all days and times.

Saving and Sharing Routes

Saving a Route

Once a route has been created, it is useful to be able to save this route for later study.

To save a route:

  1. Click 'Save Route'

  2. In the resulting pop-up, give the route a name.

To view saved routes:

  1. Click the User menu in the top-right of page.

  2. Select 'Saved Routes'

  3. Click any route in the list to reload it.

Delete a Route To delete a route, click the red trash symbol

Sharing a Route

Once a route has been created, it may be useful to share the route for others to study. Each route is represented by a URL. Anyone with the URL for a route can view it.

To find the URL for a route.

  1. Click 'Share Route'

  2. Copy the URL for your route from the pop-up.

  3. Email/text this url to anyone with a valid Open Traffic login.

Viewing Network Statistics

To view traffic statistics for an entire neighborhood, district, city, or region, use the Network tab.

On the network tab, traffic speeds are shown for all streets in the view window.

For large map areas, only major streets will be shown. For more detail on traffic statistics for smaller streets, zoom into a specific area.

Instructions for comparing times and filtering by hour, day, and week are shown below.

Comparision

In addition to viewing statistics for individual weeks, traffic statistics can be compared between multiple weeks.

To compare weeks.

  1. Create a new route on the Routing tab OR open the Network tab.

  2. Click the 'Compare' checkbox.

  3. Select the week or weeks to serve as the baseline.

  4. Select the week or weeks to serve as the comparison.

Now instead of showing traffic statistics, the graphs will show the change is speed for each day of the week or each hour of the day. For instance, if Monday has an average speed of 6kph for the baseline and an average speed of 7kph for the comparison week, Monday will show a 16.7% increase between the baseline and comparison weeks.

Confidence Interval The confidence interval tool is used to adjust the t-test. Statics for individuals segments are only compared if the data between the baseline and comparison weeks for that week pass a 2-sample t-test. Increasing the confidence interval increases the rigor of the test.

Normalize Time versus Normalize Vehicles Normalizing by vehicle will give more weight to a segment/hour that has more vehicles. Normalizing by time will weight each hour the same regardless of vehicle count.

Filtering Days and Weeks

For both the Routing and Network tabs, the data displayed can be filtered by day of week and hour of day.

  1. To enable filter, select "Enable Chart Filters"

  2. Click on hold your cursor on either the 'Speed by day of week' or 'Speed by hour of day' charts.

  3. Drag your cursor to display the chart filters and select the days and hours you wish to study.

Data Export

Data can be exported from either the Routing tab or the Network tab.

From the Routing tab:

  1. Create a route.

  2. Click the 'Export Data' button.

  3. A pop-up will prompt you to save a zip file. Name and and save the zip file.

The saved zip file will contain a shape file and a comma-separated data file. This shape file and data file contain traffic data for the the segment routed in step 1. Filters applied to the day or hour are taken into account. The first column of the data file contain a list of segment ids. Each of these ids corresponds to a segment in the shape file.

From the Network Tab

  1. Click the 'Export Data' button.

  2. A pop-up will prompt you to save a zip file. Name and and save the zip file.

The saved zip file will contain a shape file and a comma-separated data file. This shape file and data file contain traffic data for all road segments visible in the view window. Filters applied to the day or hour are taken into account. The first column of the data file contain a list of segment ids. Each of these ids corresponds to a segment in the shape file.

Comparison Mode: When in comparison mode the data file will include comparison statistics in addition to the individual traffic statistics for each time period being compared.

Internationalization

The content displayed in the right column can be displayed in a variety of languages. Use the date picker in the bottom right to select your language.

To add additional languages or update existing translations, make edits to the locale files found here.

New languages need to be added to the index.json

Branding

The logos for Grab, World Bank Group, and Korea Green Growth Partnership are stored in the source code here.

API Calls

Get Route Statistics

POST: http://BASE_URL/route

Payload (JSON):

Name Type Description
hour string used for routing at a specific time. Valid values are 0 to 23 (Used for finding the fastest route at a specific time. If this is specified, day must also be specified.)
day string used for routing at a specific time. Valid values are 1-7 where 1 is Monday and 7 is Sunday (Used for finding the fastest route at a specific time. If this is specified, hour must also be specified.)
utcAdjustment integer used to offset timezones from GMT. E.g, if your timezone is 7 hours ahead of GMT, this value should be set to 7. Valid values are -12 to 12.
confidenceInterval string sets t-test confidence interval. The confidence interval can be set to 90%, 95%, 97% or 99%. These values are mapped to 0, 1, 2, and 3 respectively. For example if you want a confidence interval of 95%, set this value to 0, if you want a confidence interval of 95%, set this value to 1.
normalizeByTime boolean Normalize by time if true. Vehicle count if false
compare boolean Is this a comparison request?
routePoints array Array of route points in the format [{"lat":LAT_1, "lng":LNG_1},{"lat":LAT_2, "lng":LNG_2}, ... , {"lat":LAT_N, "lng":LNG_N}]
w1 string Comma separated string array of week ids Week ids can be found using the get list of weeks call described below.
w2 string Comma separated string array of week ids. w2 is only used for comparison calls

*Note about utcAdjustment: if your utcAdjustment is anything other than zero, your day/hour needs to be adjusted accordingly. For instance, if you are wanting to view a trip at 10PM on Wednesday in a timezone that is 7 hours head of GMT, you should request a time of 5AM on Thursday (hour=5, day=4) with a utcAdjustment of 7. In the example below, the route was selected based on the fastest route at 10AM on Wednesday.

Example Request Payload:

{
  "hour": "17",
  "utcAdjustment": 7,
  "day": "3",
  "normalizeByTime": "true",
  "compare": false,
  "routePoints": [
    {
      "lat": -6.2774195885844435,
      "lng": 106.96117401123045
    },
    {
      "lat": -6.3277536243514545,
      "lng": 106.89456939697266
    }
  ],
  "w1": "2347,2348,2349,2350,2351,2352,2353,2354,2355,2356,2357,2358,2360,2361,2362,2363,2364,2365,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2399,2400,2401,2402,2403,2404,2405,2406,2407,2408"
}

Response:

Name Type Description
averageSpeedForRouteInKph float Average measured speed along this path.
travelTimeInSeconds float Average time to travel this path.
pathEdges Array of JSON Path Edges Each edge includes: geometry hash, color, length, speed, stdDev, inferred.
weeklyStats 168 length Array. 1 entry for each hour in the week Each entry includes: index, speed, stdDeviation.
inferred boolean If true, portions of this path used estimated speed data instead of measured data. This is done when insufficient data has been collected along a segment.

The pathEdge is an array of edges along the path. Each edge in the array contains the following:

Name Description
segmentId Id tying this segment back to OpenStreetMap
geometry Polyline of the segment
color Color code used to color the segment
length Length of the segment in meters
speed Average speed along this segment in meters per second
stdDev Standard deviation of the measured speed
inferred If inferred = true, this segment does not have sufficient data to estimate speed. Speed is inferred from nearby segments of similar road type.
count The number of vehicles counted along this segment during the time period specified in the request
speedmap An associative array keyed by each hour in the week, where hour 0 is the first hour of the week and 167 is the last hour of the week. and the value is a sum of the speeds observed in KPH. To compute the average speed, you fetch the count from the countmap and divide the sum by the count.
countmap An associative array keyed by each hour in the week, where hour 0 is the first hour of the week and 167 is the last hour of the week. For each hour in the week, the total vehicle count is shown for this segment. The sum of all hours in this object equals the count value shown in the pathEdge object.

weeklyStats is an array of length 168. There is one object for each hour of the week containing detailed information about statistics along the path for that given hour. weeklyStats contains the following information

Name Description
h The hour of the week. Valid values are 1-168
s Sum of the speeds observed in KPH, divide by c to obtain the average.
c Total measurement count during this hour along the entire path.
avg Average speed at this hour in meters per second along the entire path.
std Standard deviation at this hour along the entire path.
t Unused.
hourOfDay Hour of day. Valid values are 1-24.
dayOfWeek Day of week. Valid values are 1-7.

Get List of Weeks

GET: http://BASE_URL/weeks

Payload: none

Example: http://indonesia.opentraffic.camsys-apps.com/weeks

*You may need to be logged in for this request to work.

Response:

Name Type Description
weekStartTime int Unix time of start of week.
weekId int week id

Get Network Tab Status

GET: http://BASE_URL/weeklyStats

Name Type Description
confidenceInterval string sets t-test confidence interval
normalizeByTime boolean Normalize by time if true. Vehicle cont if false
x1 float minimum longitude bounding box
x2 float maximum longitude bounding box
y1 float minimum latitude bounding box
y2 float maximum latitude bounding box
w1 string Comma separated string array of week ids
w2 string Comma separated string array of week ids. w2 is only used for comparison calls

example:

http://BASE_URL/weeklyStats?    x1=106.805844&x2=106.8139986&y1=-6.1437399&y2=-6.1420598&confidenceInterval=95&normalizeByTime=false

Response:

168 length Array. 1 entry for each hour in the week. Each entry includes the following.

Name Description
h The hour of the week. Valid values are 1-168
s Sum of the speeds observed in KPH, divide by c to obtain the average.
c Total measurement count during this hour along the entire path.
avg Average speed at this hour in meters per second along the entire path.
std Standard deviation at this hour along the entire path.
t Unused.
hourOfDay Hour of day. Valid values are 1-24.
dayOfWeek Day of week. Valid values are 1-7.