rainbow-roads

command module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 18 Imported by: 0

README

A command line tool that animates your exercise maps, inspired by an article by Andriy Yaremenko.

example worms output

Features

  • Supports FIT, TCX, GPX files. It can also traverse into ZIP files for easy ingestion of bulk activity exports.
  • Outputs GIF, animated PNG, or a ZIP file containing each frame in GIF format.
  • Activities can be filtered by sport, date, distance, duration and geographic region.
  • Configurable color scheme.

Example usage

> rainbow-roads \
    --sport running \
    --after 2020-08-01 \
    --min_duration 15m \
    --min_distance 3km \
    --max_pace 10m/km \
    --bounded_by -37.8,144.9,5km \
    --output lockdown_worms \
    path/to/my/activity/data

Some basic statistics are output to help validate the activities that were included and to aid in further refining filters.

files:         9,327
activities:    268
records:       154,326
sports:        running (268)
period:        1.6 years (2020-08-02 to 2022-02-24)
duration:      16m1s to 1h38m27s, average 46m11s, total 206h20m19s
distance:      3.0km to 16.8km, average 7.8km, total 2,102.2km
pace:          4m25s/km to 9m21s/km, average 5m53s/km
bounds:        -37.8,144.9,4987.12259
starts within: -37.8,144.9,4807.96373
ends within:   -37.8,144.9,4912.4696

The easiest way to find the coordinates of a known location is to right-click on it in Google Maps and select the first menu item.

Options

Usage:
  rainbow-roads [flags] [input]

General flags:
  -o, --output string   optional path of the generated file (default "out")
  -f, --format string   output file format string, supports gif, png, zip (default "gif")

Filtering flags:
      --sport sports            sports to include, can be specified multiple times, eg running, cycling
      --after date              date from which activities should be included
      --before date             date prior to which activities should be included
      --min_duration duration   shortest duration of included activities, eg 15m
      --max_duration duration   longest duration of included activities, eg 1h
      --min_distance distance   shortest distance of included activities, eg 2km
      --max_distance distance   greatest distance of included activities, eg 10mi
      --min_pace pace           slowest pace of included activities, eg 8km/h
      --max_pace pace           fastest pace of included activities, eg 10min/mi
      --bounded_by circle       region that activities must be fully contained within, eg -37.8,144.9,10km
      --starts_near circle      region that activities must start from, eg 51.53,-0.21,1km
      --ends_near circle        region that activities must end in, eg 30.06,31.22,1km
      --passes_through circle   region that activities must pass through, eg 40.69,-74.12,10mi

Rendering flags:
      --frames uint        number of animation frames (default 200)
      --fps uint           animation frame rate (default 20)
  -w, --width uint         width of the generated image in pixels (default 500)
      --colors colors      CSS linear-colors inspired color scheme string, eg red,yellow,green,blue,black (default #fff,#[email protected],#[email protected],#[email protected],#[email protected],#003)
      --color_depth uint   number of bits per color in the image palette (default 5)
      --speed float        how quickly activities should progress (default 1.25)
      --loop               start each activity sequentially and animate continuously
      --no_watermark       suppress the embedded project name and version string

Beginners guide (Windows)

  1. Download the latest release of rainbow-roads and extract the ZIP archive into the same directory.
    • Advanced: Move the rainbow-roads.exe to a more permanent location in your path.
  2. Request a copy of your activity data.
    • Garmin: Follow the "Export All Garmin Data Using Account Management Center" directions in this support article.
    • Strava: Follow the "Bulk Export" directions in this support article.
  3. Download the ZIP file linked in the email they send. No need to extract it.
  4. Open the standard Command Prompt app.
  5. Run cd %HOMEPATH%\Downloads to change into the downloads directory.
  6. Run rainbow-roads export.zip where export.zip is the name of the activity ZIP file you were emailed.
    • Advanced: Specify filter options to refine the activities included (see example usage above).
  7. Open "out.gif" in a browser and enjoy the show.

Installing from source

Simply install Go and run:

go install github.com/NathanBaulch/rainbow-roads@latest

Paint

A sub-command used to track street coverage, useful for #everystreet style challenges and to make animations more spectacular.

example paint output

Features

  • Streets are painted green by running within a 25 meters threshold of them.
  • OpenStreetMap road data is automatically downloaded as needed, excluding alleyways, footpaths, trails and roads under construction.
  • A progress percentage is calculated by the ratio of green to red pixels.
  • Supports all the same activity filter options described above.

Built with

Future work

  • Improve rendering with smoother anti-aliasing
  • Provide option to strip time gaps in activities (pauses)
  • Support generating WebM files
  • Configurable dot size
  • Performance improvements
  • Localization

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL