sports-alliance / sports-lib

A Library for processing GPX, TCX, FIT and JSON files from services such as Strava, Movescount, Garmin, Polar etc
GNU Affero General Public License v3.0
155 stars 21 forks source link

Fails to import the tracklog from a Garmin Etrex 30x generated GPX #92

Open PhilWhitehurst opened 2 years ago

PhilWhitehurst commented 2 years ago

Used the following functions.


    // 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

image

The output GPX looks like this

image

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.