cwarwicker / waddle Goto Github PK
View Code? Open in Web Editor NEWPHP Library for parsing running GPS activities (.TCX .GPX .PWX .CSV)
PHP Library for parsing running GPS activities (.TCX .GPX .PWX .CSV)
When I tried updating the package with version ^1.0
, composer shows this:
- The requested package duckfusion/waddle ^1.0 exists as duckfusion/waddle[dev-master] but these are rejected by your constraint.
Apparently, Composer wants version names as "v1.0" and not "1.0".
We should probably drop the tag and create a new one.
I just tried releasing a "v1.0" tag on my fork and composer could install it without a problem.
I have a gpx file that has more than 1 < trk > section.
When I read that file with $activity->getTotalDistance()
I got only a part of the total distance.
Is there an option to read all < trk > segments at once?
example file:
https://www.dropbox.com/s/ovikbiex7ikp6zy/Grand%20TUHR.GPX?dl=1
If you're using PHP 8.1 and you try to convert the duration into a human readable string, PHP 8.1 throws a
PHP Deprecated: Implicit conversion from float 52.233333333333334 to int loses precision in vendor/duckfusion/waddle/src/Converter.php on line 102
I found a function that does the seconds to human readable conversion quickly without throwing the Deprecated notice on Stackoverflow.. https://stackoverflow.com/questions/8273804/convert-seconds-into-days-hours-minutes-and-seconds#19680778
I modified it to return what your function returns though..
/**
* This is based on the answer provided here
* https://stackoverflow.com/questions/8273804/convert-seconds-into-days-hours-minutes-and-seconds#19680778
* @param $seconds
* @return string
*/
public static function secondsToHuman($seconds) {
$dtF = new \DateTime('@0');
$dtT = new \DateTime("@$seconds");
return $dtF->diff($dtT)->format('%H:%i:%s');
}
This works for my needs, as long as I call the new method
$totalDurationInHoursMinutesSeconds = \Waddle\Converter::secondsToHuman($totalDuration);
I don't know if you're still supporting/working on this code base.. but I thought I'd send this your way. iIf you're not supporting this code base please let me know, and then I'll just make this a little helper function for the little thing I'm writing.
Hello, i need information for the type of sport/activity, how to get it?
If you try to parse a GPX file without any time information the parser will throw an exception because we have a division by zero.
This happens when we try to calculate the speed in GPXParser.php:120
The bug will probably effect the other parsers as well.
Hi there. Im looking around for decent GPS parser.
Im very new to GPS data so im not sure i get everything. I would like to parse gpx files and get data relevand for windsurfing. This would be speed at 2sec max peak, average of five 10s runs, nautical mile, 1 hour.
So if I understand correctly with getSplits i would be able to split data for example in miles return it in array and get speed for this for each new point right ?
Any idea how to split data by seconds and then get the speed from that points ?
Regards, Jaka
Parsing and setting a Lap from the following TCX values:
Parsing and setting a Point from the following TCX values:
It seems the v1.1 tag is not available in packagist, resulting in being unable to update using composer.
- The requested package duckfusion/waddle ^1.1 exists as duckfusion/waddle[dev-master, dev-pr/10, v1.0] but these are rejected by your constraint.
If I try to install dev-master I get an old commtit 02f1b2e
Could you update the package in packagist?
Hi,
thx for this great parsers.
I'm interested in "real activity time".
$activity->getTotalDuration()
does not reflect any breaks in activity.
Maybe it is possible to grep breaks to reflect real activity time. This should also affect average speed and calories, and so on.
Just an idea:
maybe by calculating speed between two points is somewhat below 5kph for biking and 2kph for walking, we got a break.
Or by calculating time between two points that are x-metres in distance to each other.
(because some people track there activity with big intervals)
thx in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.