RoadData: Batch Data Extraction of One Minute Traffic Count Data

Description Usage Arguments Value Author(s) Examples

Description

Motorway Incident Detection and Automatic Signalling (MIDAS) is a sensor based network along UK motorways, and is designed to collect data regarding traffic flows, average speeds and road occupancy, amongst other features, on the road network. This data can be accessed via the MIDAS website https://www.midas-data.org.uk/ (login required) in the form of .tcd.bz2 files.

The function RoadData is designed to improve the accessibility of the MIDAS data. This function finds relevant .tcd and .tcd.bz2 files stored on the user's machine and extracts desired information from them, returning it to the user.

Usage

1
RoadData(startDate, endDate, tcdFileRoot, ...)

Arguments

startDate

The start of the date range (in the format "YYYY-MM-DD") the user wishes to examine the data between (inclusive of this date).

endDate

The end of the date range (in the format "YYYY-MM-DD") the user wishes to examine the data between (inclusive of this date).

tcdFileRoot

A string (without a "/" or "\" character on the start or end of the string) which points to the directory (from the current working directory) that the user's .tcd or .tcd.bz2 files are stored. These files must be stored within this directory only and cannot be in any subfolders of this directory. Their names must also follow the "XXDDMMYY.tcd" or "XXDDMMYY.tcd.bz2" format as downloaded from the MIDAS website, where "XX" denotes the control office, "DD" denotes the day, "MM" denotes the month, and "YY" denotes the year.

...

Any number of geographic addresses of the links/sites that the user wishes to examine. The addresses do not need to be formatted in any particular way, and any number of addresses is allowed. The examples show how either single sites or multiple links can be selected in the function.

Value

A list, where each item in the list corresponds to a site (in the order given in the function). These items are matrices which contain the corresponding traffic data, spanning between 00:00 GMT startDate to 23:59 GMT endDate.

Author(s)

RAC Foundation, Luke Hudlass-Galley

Examples

1
2
JanuaryData <- RoadData("2016-01-01", "2016-01-31", "tcdFiles", "M25/4393A", "M25/4393B")
2013_A2/8283J <- RoadData("2013-01-01", "2013-12-31", "TrafficData/A2TrafficData", "A2/8283J")

RACFoundation/oneminutetrafficdata documentation built on May 28, 2019, 2:26 p.m.