-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parsing of GPX extensions speed, course, hAcc, vAcc #18
Conversation
Apple Watches track additional values that weren't being parsed these are: speed - speed in meters course - bearing hAcc - horizontal accuracy vAcc - vertical accuracy Add support for parsing and storing these values.
lib/gpx.js
Outdated
coordinates: ll, | ||
time: time ? nodeVal(time) : null, | ||
heartRate: heartRate ? parseFloat(nodeVal(heartRate)) : null | ||
}; | ||
|
||
const extensions = get1(x, "extensions"); | ||
if (extensions != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be !==?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is just doing a null or undefined test, it would make the test sensitive to if get1() returns undefined or null. I'd rather not be over prescriptive in case the future behavior changes. The old be generous handling with what you receive and specific with what you send.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, we aren't receiving the value from some external source - get1 is a private method that's part of togeojson and it explicitly always returns either an element or null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be all set with latest commits.
Thanks! Merging, quick check, then I'll roll a release. |
Apple Watches track additional values that weren't being parsed these are:
speed - speed in meters
course - bearing
hAcc - horizontal accuracy
vAcc - vertical accuracy
Add support for parsing and storing these values.