Code Monkey home page Code Monkey logo

cityscience's Introduction

City Science traffic visualisation demonstration

By Craig Buckler

VIEW LIVE DEMONSTRATION

Overview

Data from traffic surveys throughout Devon is shown on a heatmap. As well as map zooming and panning, the controls in the bottom right allow you to set:

  1. the survey year
  2. the type of vehicle
  3. whether the data is weighted by traffic volumes.

When weighted is unticked, the map illustrates where surveys took place. Clusters of red highlight areas where more surveys occurred.

When weighted is ticked, each survey point is factored by the volume of traffic to highlight busier locations.

Hover your cursor over any survey point circle to view the traffic figures and road information.

Supported browsers

The system works best in Chromium browsers such as Chrome, Opera and Vivaldi.

Chrome for Android, Firefox, Edge and IE11 have A-grade support but are a little slower than Chromium.

IE9 and IE10 work but have some rendering differences and may show Google Maps API warning messages.

Safari on Mac and iOS should work but has not been tested.

Development method

The original data was modified:

  • control point BNG co-ordinates were converted to latitude and longitude
  • the data set was highly compressed into a JavaScript object.

The Google Maps API is used to show the map. Heatmaps are cached on generation so it should appear faster on subsequent redraws

Each control point is drawn on first load and has the hover-over title changed when necessary.

Suggested improvements

Suggested visualisation enhancements:

  • the data could be supplemented by directional traffic information (it is not known whether each survey recorded one-way, two-way or a mixture of traffic)
  • around ten survey locations were removed because of incomplete data. Additional development could have permitted it.
  • a heatmap could be added to highlight traffic growth, perhaps by calculating a moving average or the standard deviation
  • a heatmap could be added to highlight traffic comparisons, e.g. areas with higher ratios of cyclists to HGVs
  • a more accurate representation of traffic flows could be plotted if geographical points were known

Suggested application enhancements:

  • the heatmap could be animated show changes over time
  • data could be loaded and parsed from a URL or file dragged into browser
  • data could have been cached semi-permanently (perhaps in localStorage)
  • the user's previous settings could be retained between sessions
  • GET parameters could have been set and parsed so URLs could be shared
  • the history API could recall previous choices to enable the browser back button
  • heatmap colours could be configurable
  • build tools could be used to minify, concatenate and perhaps inline all code

cityscience's People

Contributors

craigbuckler avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.