Skip to content
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

Merged
merged 2 commits into from
Dec 25, 2019

Conversation

rustyconover
Copy link

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.

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) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be !==?

Copy link
Author

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.

Copy link
Collaborator

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.

Copy link
Author

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.

@tmcw tmcw merged commit 99301bd into placemark:master Dec 25, 2019
@tmcw
Copy link
Collaborator

tmcw commented Dec 25, 2019

Thanks! Merging, quick check, then I'll roll a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants