GithubHelp home page GithubHelp logo

tomasquinones / ride-density-map Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 33 KB

Using Python and Plotly Express to show all my ride data from ridewithgps.com

License: The Unlicense

Python 100.00%

ride-density-map's Introduction

ride-density-map v0.1

I'm not looking for any PRs or new code samples. I'd like to get this figured out mainly on my own. Using Python and Plotly Express to show all my ride data from ridewithgps.com Uses https://plotly.com/python/mapbox-density-heatmaps/

Requirements:

  • Python 3.5
  • Plotly Express -- pip install ploty
  • Requests module -- pip install requests

Running it!

  1. Edit 'api_credentials.py' with your API Key, user, password, whatever
  2. You'll need your own Mapbox Token and put it into .mapbox_token file to use the dark map style.
  3. Run python3 get user_info.py -- Creates some JSON files with your trip list and more.
  4. Run python3 get_triplist.py -- This downloads all your trip data, this could take a while.
  5. Run python3 ride-density-map.py -- This will process all your JSON files in the 'trips' folder then open in your default browser. This could take a minute depending on how much data you have and your computer.

Notes:

  • You will need your own API key from Ride with GPS.

  • Currently the map auto-centers on Portland.

  • Every fifth data point is placed on the map, otherwise performance takes a huge hit or crashes the browser.

Plans:

  • Downloading data into a SQLite database rather than having hundreds or even thousands of JSON files to be process.
  • Using Pandas for the managing the data to be rendered. Supposedly this will give another performance boost.
  • Selector for map type
  • Selector for color scheme
  • Selector for date range

ride-density-map's People

Contributors

tomasquinones avatar

Stargazers

 avatar

Watchers

Arthur Jones avatar  avatar

ride-density-map's Issues

Set up unit tests

Learn how to set up unit tests
Probably need to put some of this code into functions and test things like:

  • Connecting to rwgps
  • Getting trip list
  • Getting user_info
  • Downloading data
  • Validating data

Resource:
Python Crash Course, Chapter 11

Prompt for USER_ID

Should be able to run the file, get prompted for your rwgps user_id. It will then download all available ride data.

Improve performance to show all data

Even at every fifth data point, trying to zoom out and show all my ride data is causing chrome and firefox to crash. Ever since I updated my MacBook to Big Sur performance has taken a hit.

Try 1/6 data?
Would putting the data into a Pandas or tuples help rather than 3 separate lists?

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.