Git Product home page Git Product logo

activity-map's Introduction

Local activity map

Get activity data data GPX files from Strava and display on a Map Tiler map.

Display the San Francisco Bay Trail and the Bay Area Ridge Trail with overlapping activities.

Use Map Tiler to create two maps: one with all activities, and another with the activities that overlap the Bay and Ridge trails. Use these maps to discover and plan new activities.

setup

Install requirements: pip install -r requirements.txt

Use bboxfinder.com to find coordinates for a local bounding box. Set the bounding box coordinates in the environment: BOUNDING_BOX=-122.732314,36.916954,-120.977248,37.699028

Download activity data from Strava: Download or Delete Your Account then Download Request / Request Your Archive. Wait for an email, then download the archive and copy to strava.zip.

Get an API key from Map Tiler.

Create config.js and set Map Tiler API key and path for data files:

const MAP_TILER_API_KEY = "xxx";
const HOST = 'http://localhost:8000/output'

run

initial

make download-strava prep-strava prep-ridge prep-shoreline overlap

Strava data

Download GPX files (one per activity) from Strava and combine into a geojson file for display on a map.

Run make download-strava to unzip Strava GPX files in strava.zip to strava/activities.

Run make prep-strava to combine Strava GPX tracks within a bounding box to output/routes_gz.geojson.

San Francisco Bay Trail

The San Francisco Bay Trail interactive map data is already in GeoJSON format: https://mtc.ca.gov/modules/custom/mtcca_baytrail_map/sf_baytrail.geojson. Save to bay_trail/bay_trail.geojson.

Run make prep-shoreline to filter the data to a subset of fields for existing, in use trails and write to output/bay_trail.geojson.

Bay Area Ridge Trail

The Bay Area Ridge Trail doesn't seem to have trail data in geodata format. The Bay Area Ridge Trail list on AllTrails includes 76 trails; click Download route on an individual trail page to download a GPX file for that segment. This downloads files with a .js (not .gpx) extension, although the data format is GPX.

Run make prep_ridge to combine GPX files in in ridge_trail/ to GeoJSON format in output/ridge_trail.geojson.

Generate overlapping trail data

Run make overlap to combine trail data (output/bay_trail.geojson, output/ridge_trail.geojson) with Strava activity data (output/routes.geojson). Write overlapping routes to output/trail_routes.geojson.

updates

make download-strava prep-strava overlap

Download Strava data to strava.zip, add new routes to output/routes.geojson, and re-create overlapping route / trail data.

Run make sync to sync data to S3 bucket in S3_BUCKET environment variable.

view map

Start local server: python -m http.server

View activity heatmap: http://localhost:8000/index.html

View activity heatmap with Bay trails: http://localhost:8000/bay.html

resources

activity-map's People

Contributors

kielni avatar

Watchers

 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.