question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KML & GPX presets- invalid characters

See original GitHub issue

Hello,

Firstly- thank you for gopro-telemetry- I’m only getting started, but it seems very useful

When using the gpx & kml presets, the output contains invalid characters- for example in the KML file, \n and \ characters image

I can fix this by post-processing the output files, but how can I prevent this from occurring ?

thanks

Andrew

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JuanIrachecommented, Nov 2, 2022

I see. Maybe the module is escaping those special characters under certain circumstances? It does not seem to happen on my end, but we can leave this open to keep an eye on it

0reactions
fornacommented, Dec 20, 2022

Looking at the first screenshot, in addition to the \n you also have the escaped quotes \" It means you are using JSON.stringify to save the GPX data. However the GPX is in XML, not JSON, so it is incorrect to use the JSON.stringify.

While for full telemetry it looks like this (notice the fs.writeFileSync with JSON.stringify):

gpmfExtract(file)
    .then(extracted => {
        goproTelemetry(extracted, {}, telemetry => {
            fs.writeFileSync('full-telemetry.json', JSON.stringify(telemetry));
            console.log('Telemetry saved as JSON');
        });
    })
    .catch(error => console.error(error));

For the GPX it looks like this (no JSON.stringify):

gpmfExtract(file)
    .then(extracted => {
        goProTelemetry(extracted, {
            preset: 'gpx'
        }, telemetry => {
            fs.writeFileSync( 'gps-only.gpx', telemetry);
            console.log('GPS saved as GPX');
        });
    })
    .catch(error => console.error(error));

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with navigation files (kml, gpx) to load from within
In the instance of using Google Earth, I have it set up to open both kml and gpx file by double clicking the...
Read more >
qgis - Problems when converting KML files to GPX
Looking at the KML and the GPX file that I created (in QGIS through 'Save as'), in QGIS it looks as if the...
Read more >
The KML file contains invalid or unsupported data, or the file is ...
A KML (as an XML file) must be well-formed and properly encoded. One issue in the KML file is one of the entity...
Read more >
GPX Problems in Maps - Adobe Support Community - 8784378
I get my GPX file by converting a KML file from Google location history at https://kml2gpx.com/ . I've tried other converters and its...
Read more >
GPS Visualizer Help
And Garmin files (GPX or .gdb) frequently have specific symbols attached to their waypoints. Whenever possible, GPS Visualizer will try to preserve the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found