/bicycle-counts

Bicycle count data with schemas, a data package and tests

Average Bicycle Counts by Day and Hour

goodtables.io

This dataset contains average counts of bicycle traffic by hour of the day and day of the week. It includes the location of data collection sites.

The data is a snapshot and not planned to be kept up-to-date. The main purpose of this repository is to develop a data package and schemas for this dataset.

Data

The data is collected from bicycle counters across 14 active transport sites. As more sites come on line in the future these will be added to the dataset. These bicycle counters were installed in conjunction with the State Cycle Unit and are permanent installations that provide 24/7 bicycle counting data.

The data is made up of two of files.

  1. Average Bicycle Counts by Day and Hour, by Transport and Main Roads, Queensland Government, licensed under Creative Commons Attribution sourced on 20 September 2016.
  2. Active transport sites, by Transport and Main Roads, Queensland Government, licensed under Creative Commons Attribution sourced on 20 September 2016.

Each data file is defined by a schema. The schemas follow the json table schema specification.

These schemas will be combined into a datapackage.json file to fully describe the data collection. The datapackage.json file will follow the data package specification.

Preparation

The data was downloaded from the source and then uploaded to GitHub.

Tests

The focus of the tests is to ensure the schemas are correct. The tests are invalid data that is used to ensure the schema detects all errors (e.g. incorrect types and violated constraints).

Results

The results can be verified using links to Good Tables. Tests include:

  • testing the valid data without a schema
  • testing the valid data with a schema
  • testing the invalid data with a schema

Good Tables doesn't check all types of errors (yet). Somethings not checked include:

  • Foreign keys. (See Good Tables #17, #8)
  • Some constraints (See Good Tables #55)

Continuous Testing

GoodTables.io provides continuous data testing. Everytime there's a change in this repository the tests are re-run. Here's the latest results:

goodtables.io

Schemas

The schemas were created using Data Packagist. Using Data Packagist:

  • add some basic information about the data file (name, description, license, etc.)
  • upload the data file

Data Packagist will create a datapackage.json file for you. Download this file.

Good Tables can only use a json table schema for validation (see goodtables-web #65). You can extract the json table schema from the datapackage.json file. It's this bit {fields: [...]}. Save this a separate file.

Edit the schema file with a text editor (e.g. ATOM, jsoneditoronline.org) and add constraints, refine types and formats, etc. You may like to use the json table schema schema to improve your editing experience.

Some constraints use regular expressions to define a pattern. Use a online tool to help create and test a regular expresion e.g. regexr.com or regex101.

View the Data Package

Data packages are about providing machine-readable metadata for your data. You can view a human-readable version of the data package data, and readme files using the Data Package Viewer. There are a couple of issues with the viewer including providing an incorrect link to the metadata data.okfn.org-new #9.

License

All items in this repository, apart from the data, are licensed under Creative Commons Attribution 4.0.