Comments (7)
Hi,
so you have problem with reading heart rate from GPX files at all or hr is not shown in statistics?
Currecntly I am calculating stats only for basic data as distance, elevation etc. I don't know exactly how to calculate stats properly from extension objects such as Garmin TrackPointExtension, because I want to find an universal way and support all the extensions in the end.
If you have problems with reading heart rate at all, that probably a bug which have to be fixed, so please let me know.
It's also nice to hear that phpGPX is easy to integrate and helpful for you :)
from phpgpx.
(
[distance] => 6513.8143967259
[avgSpeed] => 3.4907901375809
[avgPace] => 286.46809478298
[minAltitude] => 122
[maxAltitude] => 132.9
[cumulativeElevationGain] => 40.1
[startedAt] => 2016-08-25T20:42:35+00:00
[finishedAt] => 2016-08-25T21:13:41+00:00
[duration] => 1866
)
that's one of my sample gpx files which are output (dumped from $track->stats->toArray())
while the gpx file obviously uses heart rate too.. gpxtpx:hr on each gps tracking i guess i could still get it done (i have used simplexml on gpx files before) but i don't want to run 2 seperate readouts for HR while phpGPX already is very simplistic...
<trkpt lat="50.162982000" lon="8.623605000">
<ele>128.5</ele>
<time>2016-08-25T20:44:18Z</time>
<extensions>
<gpxtpx:TrackPointExtension>
<gpxtpx:hr>152</gpxtpx:hr>
</gpxtpx:TrackPointExtension>
</extensions>
</trkpt>
from phpgpx.
The stats attribute contains only aggregated/calculated data from GPX file ($track->stats
object contain statistics from the whole file - all segments & points). If you want to access extensions data (gpxtpx:hr is not part of original GPX specification, but it's an Garmin TrackPoint extension - fully supported by phpGPX).
Heart rate belongs to point, not to whole track. phpGPX not currently support stats for the extensions as I said before. I am looking for the best implementation how to calculate stats for all kind of extensions.
If you want to access Garmin TrackPointExtension data, you can use
$track->segments[0]->$points[0]->extensions->trackPointExtension->hr;
var_dump($track->segments[0]->points[0]->extensions->trackPointExtension->);
If you still can't find the extension data, please let me know, is probably a bug which have to be fixed. I hope I helped you, if there is still something unclear feel free to ask ;)
from phpgpx.
yeah i can call each single point...
i guess i would have to go manually iterate though each point[$i]->extension->track...->hr;
and calculate the average
from phpgpx.
Yop,
I am so sorry but currently there is no other way :( But once I will be done with tests and new documentation, this is the first thing for marked for implementation.
from phpgpx.
no worries
from phpgpx.
I would like to implement this using middlewares in 2.x
. Please check #67 for more information.
from phpgpx.
Related Issues (20)
- Error when last trk point does not have a time set HOT 1
- Cumulative elevation loss HOT 2
- Implementing way point and creation time extensions HOT 1
- use custom trackpoint extension (in this case: Bad-Elf)? HOT 8
- Elevation string float becomes null in getJSON() call HOT 3
- cumulativeElevationLoss is missing in stats HOT 1
- Tag a new version HOT 3
- Error when $person->links is null HOT 2
- Should be 1.1.0 HOT 1
- startedAt and finishedAt values are not present if the first (or last) point is without timestamp
- Error installing with composer HOT 2
- cumulativeElevationGain and cumulativeElevationLoss not correct when missing parts of track with gps problem? HOT 10
- Class Error (Fatal error: Uncaught Error: Class "phpGPX\phpGPX" not found in) HOT 3
- [PR advise] Add coordinates for remarqued statistic points HOT 2
- phpGPX\Parsers\ExtensionParser::toXML(): Argument #1 ($extensions) must be of type phpGPX\Models\Extensions HOT 2
- Waypoints at the root of the gpx tag HOT 5
- Middlewares
- Removal of Summarizable and toArray HOT 2
- Minimum altitude is not necessarily the first point HOT 3
- Add version GPX
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpgpx.