// For GPX you need a string
SportsLib.importFromGPX(inputFile,DOMParser).then((result) => {
// do Stuff with the file
// convert to gpx
const gpxPromise = new EventExporterGPX().getAsString(result);
gpxPromise.then((gpxString) => {
// writes the gpx to file
fs.writeFileSync(`${userPath}/result.gpx`, gpxString, 'utf8');
});
The input GPS looks like this
The output GPX looks like this
It's gone from 1348 trackpoints on the input file to 6 trackpoints on the output file.
It seems to generate the statistics ok, it just doesn't work when it comes to preserving the tracklog data from an Etrex30x GPX file.
Used the following functions.
The input GPS looks like this
The output GPX looks like this
It's gone from 1348 trackpoints on the input file to 6 trackpoints on the output file.
It seems to generate the statistics ok, it just doesn't work when it comes to preserving the tracklog data from an Etrex30x GPX file.