Endurance

PHP library for parsing cycling GPS activities and calculating metrics.

3 years after

Endurance

Endurance is a PHP library for parsing cycling GPS activities and calculating metrics.

Usage

Parse TCX files from Garmin devices

<?php

use Endurance\TCXParser;

$parser = new TCXParser();
$activity = $parser->parse('/path/to/activity.tcx');

Calculate useful metrics

<?php

use Endurance\Calculator\HeartRateZoneCalculator;
use Endurance\Calculator\MetricCalculator;
use Endurance\Metric\AverageMovingSpeedMetric;

$zoneCalculator = new HeartRateZoneCalculator();
$zones = $zoneCalculator->calculateZones(182);

$metricCalculator = new MetricCalculator();
$metrics = $metricCalculator->calculate(array(
    'averageMovingSpeed' => new AverageMovingSpeedMetric()
), $activity->getPoints(), $zones);

// Returns an associative array of the calculated metric values
// $metrics = ['averageMovingSpeed' => 26.43]

Running the Tests

Setup the vendor directory

$ cd endurance
$ php composer.phar install --dev

Launch the test suite

In the root directory:

$ phpunit

Is it green?

Related Repositories

meteor-scrape

meteor-scrape

Scrape any Website or RSS/Atom-Feed with ease. ...

spark-flashee-eeprom

spark-flashee-eeprom

Eeprom emulation using external flash on Particle devices. Includes unit tests c ...

evolb

evolb

An open source HTML5 game that aims to teach concepts in evolution ...

GarminConnectClient

GarminConnectClient

A simple PHP library to interact with the Garmin Connect website and APIs ...

GMCPAdditions

GMCPAdditions

These are additions to the IRE gmcp documentation ...


Top Contributors

noginn