pdhoopr / gps-to-gpx Goto Github PK
View Code? Open in Web Editor NEWA simple tool that uses GPS waypoint data to generate GPX.
Home Page: https://npm.im/gps-to-gpx
License: MIT License
A simple tool that uses GPS waypoint data to generate GPX.
Home Page: https://npm.im/gps-to-gpx
License: MIT License
This is blocked by eslint-config-airbnb. Waiting on them in this issue to update their peer dependencies for v3.
Hi,
In my particular use case, I always have all the keys defined but the value is not always defined. Typically, my waypoints can look like
[{ elevation: 10, ... }, { elevation : null, ... }, { elevation: 20, ... }]
With the current code and the check for hasOwnProperty
, the property is always defined, so the <ele>
tag is always emitted (with empty value).
What about switching the hasOwnProperty
test to point[eleKey] !== null && point[eleKey] !== undefined
for example? This would avoid emitting such values.
I could also handle this by pre-filtering my data, not sure what sounds best for you.
Thanks!
Hi,
Actually, I've just noticed the current version of the lib output a GPX 1.1 file (which is latest version). This is perfectly fine and works well except for the recently added course
field. Actually, course
is defined in GPX 1.0 spec: http://www.topografix.com/gpx_manual.asp.
However, it seems to have disappeared from the GPX 1.1 spec: https://www.topografix.com/gpx/1/1/.
Not sure what is best to do here, either:
course
element in GPX 1.1 which might not be valid.course
.course
.Best,
Hi, this is a wonderful tool for importing tracks, but it would be even better if it could also highlight individual POIs with identifying icons/text. Would that be hard to implement?
I was wondering if the input array could have another element indicating that it was a POI rather than a point on a track, e.g. "name" and it could generate a "wpt" instead of a "trk".
Thanks!
Hi,
I would like to use track point extensions in generated xml files so I can add heart rate, candence and other metrics. It should look like this:
<trkpt lat="54.8591470" lon="-1.5754310">
<ele>29.2</ele>
<time>2015-07-26T07:43:42Z</time>
<extensions>
<gpxtpx:TrackPointExtension>
<gpxtpx:atemp>11</gpxtpx:atemp>
<gpxtpx:hr>92</gpxtpx:hr>
<gpxtpx:cad>0</gpxtpx:cad>
</gpxtpx:TrackPointExtension>
</extensions>
</trkpt>
It is simple to implement:
if (point.extensions) {
const trackExtension = trkpt.ele('extensions').ele('gpxtpx:TrackPointExtension');
Object.keys(point.extensions).forEach((key) => {
trackExtension.ele(`gpxtpx:${key}`, point.extensions[key]);
});
}
Could you add it to this library?
This is a minor detail, but converting Date objects to ISO 8601 would be nice.
As of now, if you pass a Date object, you end with a UNIX TIMESTAMP. You can obviously do a .toISOString()
previous to passing the dates, but handling it automatically would be better.
ActivityName from options is now used only in Track-level name-field and in the top level metadata name-field is always "Activity". However it appears that at least some Garmin devices use top level metadata in the UI and therefore always present GPX-tracks generated by this library with name "Activity".
I know very little of GPX-format however took a quick look at some other GPX-tracks e.g. those produced by Strava Routes, all those seemed to have same name-field both at the top level and track.
Propose either a new options-field is added for the top level name-field or if it's in line with GPX-format just use existing ActivityName.
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.