Endurance is a PHP library for parsing cycling GPS activities and calculating metrics.
<?php
use Endurance\Parser\TCXParser;
$parser = new TCXParser();
$activity = $parser->parse('/path/to/activity.tcx');
<?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]
$ cd endurance
$ php composer.phar install --dev
In the root directory:
$ phpunit
Is it green?