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

adding garmin extensions #26

Open
Sprechen opened this issue May 9, 2024 · 2 comments
Open

adding garmin extensions #26

Sprechen opened this issue May 9, 2024 · 2 comments

Comments

@Sprechen
Copy link
Contributor

Sprechen commented May 9, 2024

I need to add information to my trk infos, specifically I need to add the speed of each point in the segment.
This is defined by the garmin extension https://www8.garmin.com/xmlschemas/TrackPointExtensionv2.xsd.
As I understand, for each point I can use the extensions map to add additional data for each Wpt point, but how I can add schemas to the Gpx node?

@kb0
Copy link
Owner

kb0 commented May 9, 2024

It's possible to use GpxWriter().asXml. For ex.:

final gpxXml = GpxWriter().asXml(gpx);
gpxXml.children[1].setAttribute("xmlns:trp", "http://www.garmin.com/xmlschemas/TripExtensions/v1");
gpxXml.children[1].setAttribute("xsi:schemaLocation", "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd");
gpxXml.toXmlString()

@Sprechen
Copy link
Contributor Author

Sprechen commented May 9, 2024

It's possible to use GpxWriter().asXml. For ex.:

final gpxXml = GpxWriter().asXml(gpx);
gpxXml.children[1].setAttribute("xmlns:trp", "http://www.garmin.com/xmlschemas/TripExtensions/v1");
gpxXml.children[1].setAttribute("xsi:schemaLocation", "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd");
gpxXml.toXmlString()

Ok thank you! So, no native support for that!
Maybe, I can make a pull request with this feature

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

No branches or pull requests

2 participants