Sign inSign up

synchronicityiot/bike-data-visualiser

By synchronicityiot

Updated over 7 years ago

Small front-end to visualise the TrafficFlowObserved, Vehicle and BikeHireDockingStation data.

Image
0

321

synchronicityiot/bike-data-visualiser repository overview

Synchronicity Bike Data Visualiser (TFO, Vehicle, BikeHireDockingStation)

Description

There is a lot of traffic in cities these days. A lot of people ride their bikes everyday to work, congestion points arise, and it is important to pinpoint those to further streamline the in and outflow of the city. A lot of bicycle data can be gathered but it is hard to see and use it to produce useful information. This can be done by transforming plain bicycle data lines into TrafficFlowObserved format. The objectives of this application are gaining insight into the traffic of bicycles on any given day and hour. This can be used to see congestion points and adjust the city infrastructure based on that. The background conditions this application needs, are useful, consistent bicycle data which is delivered by tracking Ring-Ring bicycles. Ring-Ring is a company for which you can ride your bike and transfer your kilometers into discounts at your local stores. 22 million data lines were gathered which can produce valuable insights into traffic flow of the city. These data lines need to be transformed into TrafficFlowObserved and gathered into new data lines. Each trip was recorded and average speed on any given street segment can be calculated. The The amount of vehicles at a given time and place is also taken into account to see the busy places and gain insight into routes people take when they go to work or when they go to do leisure activities in the weekend. Difficulties which will be faced are the sheer amount of data which needs to be transformed. The 22 million lines need to be processed and stored into buckets with a time interval of 15 minutes along with each street segment gathered by OpenStreetMap. This application will have a frontend which will visualise the data and insights can be gathered from there on. Separate vehicle data will also be visualised, this will represent the 22 million Ring-Ring lines, when plotted as a heatmap it will become clear where people like to ride their bikes and which places they try to avoid. The city can plan new infrastructure or infrastructure changes based on their findings of this data.

How to use it

Data is gathered from Ring-Ring data, which is gps data from bicycles. A Ring-Ring line looks as follows: 3301318127;2017-02-01,06:53:28;51.204183;4.347533;false;6.24;145.0;Bike. It contains the gps coordinates, date, speed and heading. This data will flow through Nifi, transformed into NSX and NSGI format (done in gps-to-tfo-transformer repository) and stored in an Orion database where it can be accessed.

  • frontend will connect via the SYNCHRONICITY_API_HOST environment variable to the Orion database
  • configuration about the exact endpoint the frontend uses is located in the .env.local file and .env file in the config folder, this file will be read and will be set as environment variables
  • constants are defined in api.constants.js, such as which endpoint to use for each of the following types TFO, Vehicle, BikeHireDockingStation

Take a closer look at the package.json file for all available run and build commands.

"scripts": {
    "env:local": "cp config/.env.local .env",
    "env:remote": "cp config/.env .env",
    "start": "yarn env:local && node scripts/start.js",
    "build": "yarn env:remote && node scripts/build.js",
    "build:local": "yarn env:local && node scripts/build.js",
    "test": "jest",
    "flow": "flow",
    "lint": "eslint src",
    "lint:fix": "yarn lint --fix",
    "jsonserver": "json-server --watch json-server/db.json -p 3001"
}

Interface and API

Frontend will do HTTP calls with urls queries having following format, for example: ?type=TrafficFlowObserved&q=hour==00:00,02:00,01:00,03:00&limit=1000&offset=0&options=count, this is specific for Orion databases.

The UI has a filter where users can specify the start and end date they want to search on, along with a day filter so they can select the day and a quarter hour filter which enables them to specify up to 15 minutes to filter the data on. It is also possible to search for Vehicle, TrafficFlowObserved and/or BikeHireDockingStation data. The Vehicle data is plotted as a heatmap to visualize the busy spots at a specified time and date. The TrafficFlowObserved data is plotted as lines which has visual indicators to represent the data on each line. For example, the colour helps visualize the average speed on a particular road segment and the thickness of the lines represents the intensity at that given time and date. The BikeHireDockingStations are visualized through icons dispersed throughout Antwerp.

Service Architecture

This baseline service is composed by 2 major components. The Frontend and the Orion database. The Frontend does requests and filtering on the data and sends these queries to the Orion database. User initiates the filtered search on the Bike Data Visualiser application, it then proceeds to do a filtered search to the underlying Orion database to get the filtered data and returns this to the application to be visualised like the images below. TrafficFlowObserved, Vehicle and BikeHireDockingStation data is visualised.

Service Deployment

  • clone this project
  • run yarn install to install the dependencies
  • run yarn start to start application
  • go to http://127.0.0.1:3000 in your browser
Via Docker
yarn build
docker build . -t synchronicity-frontend:0.0.1
docker run synchronicity:0.0.1

Native installation

yarn install
yarn start

System Requirements

Minimum requirements to run this atomic service:

About

The RingRing data is gathered through bycicles riding through the city. You can find more information here.

Support

The support for this baseline services can be requested via the issue tracker here.

License & Terms and Conditions

This baseline service is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Please refer to gnu licenses for more information.

The software is released as it is and we discharge any liability.

Tag summary

Content type

Image

Digest

Size

11.9 MB

Last updated

over 7 years ago

docker pull synchronicityiot/bike-data-visualiser