Git Product home page Git Product logo

josm_strava_cookies's Introduction

josm_strava_cookies

Utility for setting Strava cookies in JOSM preferences. This allows to get high-resolution Strava Heatmaps as an overlay in JOSM. Permission has been granted by Strava, see https://wiki.openstreetmap.org/wiki/Strava and https://wiki.openstreetmap.org/wiki/Permissions/Strava

Requirements

This tool relies on Python 3, which comes pre-installed on most *x systems. For macOS, a convenient way to install Python 3 is homebrew; see, e.g., https://docs.python-guide.org/starting/install3/osx/

For Safari users on macOS, no further packages are needed. For Chrome or Firefox users, please install the package browser_cookie3 (from command line, run $ pip3 install browser_cookie3): https://github.com/borisbabic/browser_cookie3

This tool supports macOS and Linux. Support for Chrome/Firefox on Windows has been added but not yet tested--test reports are welcome!

Usage

  1. Browse to the Strava Heatmap and setup a Strava account.
  2. Log in with your Strava credentials, flagging the remember me checkbox. Move the map and zoom in and out to be sure that the required cookies are present.
  3. In JOSM preferences, activate the Strava imagery URLs that you need.
  4. Change each default imagery URL string from e.g.:
tms[3,11]:https://heatmap-external-{switch:a,b,c}.strava.com/tiles/run/hot/{zoom}/{x}/{y}.png

to:

tms[3,15]:https://heatmap-external-{switch:a,b,c}.strava.com/tiles-auth/run/hot/{zoom}/{x}/{y}.png
  1. Close JOSM.
  2. If using Safari on macOS: grant Terminal with full disk access (macOS System Preferences > Security & Privacy > Privacy > Full Disk Access > Add the Terminal application).
  3. From the command line, run $ python3 josm_strava_prefs_upd.py
  4. The imagery URL should be updated to:
tms[3,15]:https://heatmap-external-{switch:a,b,c}.strava.com/tiles-auth/run/hot/{zoom}/{x}/{y}.png?Key-Pair-Id=<YOUR_KEY_PAIR_ID_COOKIE_VALUE>&Policy=<YOUR_POLICY_COOKIE_VALUE>&Signature=<YOUR_SIGNATURE_COOKIE_VALUE>

Cartograph support

It is also possible to prepare Strava Heatmap TMS URLs for Cartograph. Cartograph runs under iOS and macOS, as well as Android.

Run $ python3 carto_strava_omapdef.py to write out Strava URLs in an online map definition file. An online map definition file is a JSON file that can be imported directly in Cartograph.

A choice will be offered to save the omapdef file either in the current directory or in iCloud. The latter option is only relevant for macOS users, and the file will be saved in the <HOME>/Library/Mobile Documents/com~apple~CloudDocs/Cartograph Pro folder, for an easy import into Cartograph from mobile devices.

After importing the map definition file in Cartograph, the following maps will be available in the Manage Maps menu:

  • Strava Heatmap (all)
  • Strava Heatmap (ride)
  • Strava Heatmap (run)
  • Strava Heatmap (winter)

Before importing a new map definition file to update the Strava URLs, remove any previous Strava Heatmap.

Licence

josm_strava_cookies's People

Contributors

solitone avatar smoothefiets 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.