endurance / activity-gpx
GPX recorded tracks mapped to Endurance Activity import streams
v0.2.0
2026-11-23 20:54 UTC
Requires
- php: ^8.5
- endurance/activity: ^0.2.0
- endurance/activity-analysis: ^0.2.0
- endurance/foundation: ^0.2.0
- endurance/gpx: ^0.2.0
Requires (Dev)
- phpunit/phpunit: ^12.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-23 20:58:04 UTC
README
Import one recorded GPX track through Endurance Activity's staged writer.
composer require endurance/activity-gpx
Supply an Activity stream importer and an application callback that creates the Activity with the validated start time:
use Endurance\ActivityGpx\Import\ImportGpxActivity; $result = new ImportGpxActivity($activityStreamImporter)->import( activityId: $activityId, idempotencyKey: $stableRetryKey, source: $stream, onPrepared: fn ($start) => $ensureActivityStarted->handle($activityId, $start), );
- Exactly one nonempty track is required. Every point needs a zoned absolute
timestamp with at most six fractional digits, ordered across all segments.
Multiple tracks and route-only/untimed inputs raise
UnsupportedGpxActivity. - The caller owns the input. A private disk spool validates the whole document
before
onPreparedand generation acquisition. Memory is bounded; temporary disk use grows with input.onProgresssupports cancellation and lease checks. onImportedruns inside activation. Retries use the same Activity/idempotency key; a completed import does not publish or invoke that callback again.- Reports distinguish reported readings from derived GPS estimates. Segments preserve gaps; they do not imply pauses. No sessions, laps or timer events are invented, and elapsed time is not measured timer time.
For an already selected track, PrepareGpxTrackActivity::prepare() accepts a
completed GPX read and a repeatable point factory. Keep that source unchanged
until the prepared items have been fully consumed.
Types in Internal and elements marked @internal are not public API.
License: MPL-2.0.