Giter Club home page Giter Club logo

velocity's Introduction

Introduction

Vélocity is a tool allowing cyclists to discover new and interesting bike routes. This app dynamically generates and stores bike routes based on a user-specified location and either total distance or a midpoint location.

Statement of Purpose

As an avid cyclist, I love finding new bike routes but find myself sticking to a handle of favorite rides (it's hard to beat the Marin Headlands). The idea of a bike route generator was born. To allow for the greatest variety of routes, the generator randomizes the direction of the first leg, the number of waypoints, the length of each leg, and the clockwise or counterclockwise direction of the route. A predictive algorithm biases the routes in favor of the directions a user prefers riding.

Recent Updates

  • Chart.js integration, displaying the percentage of time a user prefers a route starting in a given cardinal direction
  • Now mobile-friendly!
  • Using the Google Maps Places API, I added autocomplete to address fields
  • Improved test coverage

User Interface

The homepage allows the user to create a route based on:

  1. A saved address
  2. A route type ("loop" generates a round-trip route, while "midpoint" allows the user to specify the halfway point)
  3. Number of miles (for "loop" routes) or midpoint address (for "midpoint" routes)

On the backend, this project uses a predictive algorithm (Markov Chain) to determine the cardinal direction for the route based on the user's historical route choices, generates a loop based on this information, and displays the route with corresponding metrics using Google Maps APIs. The Chart.js integration provides the user insight into data produced by this predictive algorithm.

Route Creator

Saved routes can be filtered and sorted to allow the user to find a route suiting their needs.

Saved Routes

Behind the Scenes

In order to generate the largest number of unique bike routes, I perform the following:

  1. Generate a loop starting in a randomized direction
  2. Following the initial leg, randomize the clockwise / counter-clockwise direction of the loop
  3. Initially, I calculated latitude/longitude pairs by forming an equilateral triangle: I took the specified miles and divided them evenly, then through some trigonometry fun derived the latitude and longitude. Now I randomize between 3 and 4 legs on each route and with varying leg lengths.

Tech stack

  • Python
  • Javascript (including jQuery, AJAX)
  • Chart.js
  • Jinja
  • Flask
  • SQLAlchemy
  • Bootstrap
  • Google Maps APIs (Elevation, Directions, Geocode, Places)

velocity's People

Contributors

valeriewilson 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.