GPS::Track - Perl extension for parsing GPS Tracks
use GPS::Track; my $track = GPS::Track->new; my @trackPoints = $track->parse($filename); # Parse-Callback my $track = GPS::Track->new(onPoint => sub { my $trackPoint = shift; }); my @trackPoints = $track->parse($filename);
GPS::Track tries to parse common GPS Tracks recorded by diffrent GPS/Sports trackers.
Under the hood the conversion is done by calling gpsbabel on your system.
WARNING: This is a early Alpha! Use at your own risk!
Callback which gets called for every parsed GPS::Track::Point. Gets the parsed GPX::Track::Point passed as argument.
$track->onPoint(sub { my $trackPoint = shift; $trackPoint->lon; });
Usefull for "in place statistics" to prevent useless looping over all points more than once.
Tries to parse the given filename and returning all the parsed GPX::Track::Points as an array.
Additionally if the 'onPoint' attribute is defined, it will be called for every parsed point.
Converts the file from the identified format to the internaly used XML format.
my $xml = $track->convert($filename);
Tries to identify the type of file by looking at the suffix.
TODO: Interpret file magic bytes.
my $format = $track->identify($filename);
Convert a .FIT file to TCX
Convert .GPX file to TCX
Convert .TCX fit to TCX
This may seem "useless". But in reality GPSBabel does a lot of cleanup for us when converting TCX 2 TCX.
Calls the gpsbabel binary and fetches the result vom STDOUT and returns a string as TCX.
my $tcx = $track->gpsbabel_convert($sourceFormat, $sourceFile)
To be done.
Sven Eppler, <cpan@sveneppler.de>
Copyright (C) 2017 by Sven Eppler
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.24.0 or, at your option, any later version of Perl 5 you may have available.
To install GPS::Track, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GPS::Track
CPAN shell
perl -MCPAN -e shell install GPS::Track
For more information on module installation, please visit the detailed CPAN module installation guide.