GithubHelp home page GithubHelp logo

j-hiller / strava-local-heatmap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from remisalmon/strava-local-heatmap

0.0 0.0 0.0 4.96 MB

Python script to generate a high resolution heatmap from Strava GPX files

Home Page: https://git.io/fjXTL

License: MIT License

Python 99.08% Shell 0.92%

strava-local-heatmap's Introduction

strava_local_heatmap.py

Python script to reproduce the Strava Global Heatmap (www.strava.com/heatmap) with local GPX data

Optimized for cycling activities ๐Ÿšด

Check out github.com/remisalmon/Strava-local-heatmap-browser for an interactive version

Features

  • Minimal Python dependencies (matplotlib+numpy)
  • Fast (3x faster than gpxpy.parse())

Usage

Command-line options

usage: strava_local_heatmap.py [-h] [--gpx-dir DIR] [--gpx-year YEAR]
                               [--gpx-filter GLOB]
                               [--gpx-bound BOUND BOUND BOUND BOUND]
                               [--output FILE] [--zoom ZOOM] [--sigma SIGMA]
                               [--no-cdist] [--csv]

optional arguments:
  -h, --help            show this help message and exit
  --gpx-dir DIR         GPX files directory (default: gpx)
  --gpx-year YEAR       GPX files year filter (default: all)
  --gpx-filter GLOB     GPX files glob filter (default: *.gpx)
  --gpx-bound BOUND BOUND BOUND BOUND
                        heatmap bounding box coordinates as lat_min, lat_max,
                        lon_min, lon_max (default: -90 +90 -180 +180)
  --output FILE         heatmap name (default: heatmap.png)
  --zoom ZOOM           heatmap zoom level 0-19 (default: 10)
  --sigma SIGMA         heatmap Gaussian kernel sigma in pixels (default: 1)
  --no-cdist            disable cumulative distribution of trackpoints
                        (uniform distribution)
  --csv                 also save the heatmap data to a CSV file

โš ๏ธ --zoom is OpenStreetMap's zoom level, first number after map= in www.openstreetmap.org/#map=

Example:
strava_local_heatmap.py --gpx-dir ~/GPX --gpx-year 2018 --gpx-filter *Ride*.gpx --zoom 13

For an explanation on the cumulative distribution function, see:
https://medium.com/strava-engineering/the-global-heatmap-now-6x-hotter-23fc01d301de

Output

heatmap.png
heatmap_zoom.png

heatmap.csv
See https://umap.openstreetmap.fr/en/map/demo-heatmap_261644 (contribution by @badele)

Setup

Run bash setup.sh && source virtualenv/bin/activate

Python dependencies

matplotlib==3.0.2
numpy==1.15.4

Other dependencies

Arch Linux (see here): sudo pacman -S tk

Projects using strava_local_heatmap.py

JeSuisUnDesDeux

strava-local-heatmap's People

Contributors

badele avatar chrinimue avatar j-hiller avatar remisalmon 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.