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

Version 1.1 and <link> #81

Closed
wrohdewald opened this issue Jan 25, 2017 · 3 comments
Closed

Version 1.1 and <link> #81

wrohdewald opened this issue Jan 25, 2017 · 3 comments

Comments

@wrohdewald
Copy link
Contributor

Download track from mapmytracks: comes in version 1.1 with no tags.

Because all trackpoints come on one single line, parse and to_xml() with gpxpy

now there are tags without values for every trackpoint and in other places.

Would it be possible to suppress them when they have no value?

@tkrajina
Copy link
Owner

I'm not 100% sure if I understand the problem. Can you provide a GPX file and the code to reproduce the problem?

@wrohdewald
Copy link
Contributor Author

download a track from mapmytracks.com - but I think this happens with any input, i also tried one from a different source. As long as the input version is 1.1 as in

<gpx xmlns="http://www.topografix.com/GPX/1/1"

then use this filter:

cat input.gpx | ./lf.py

and every trackpoint gets

lf.py is:

import sys
import gpxpy
gpx = gpxpy.parse(sys.stdin.read())
sys.stdout.write(gpx.to_xml())
sys.stdout.write('\n')

@tkrajina
Copy link
Owner

tkrajina commented Mar 5, 2017

Unfortunately at the moment this would need a bigger refactory (the way the XML file is created. It should probably use a DOM builder, not string concatenation). I'll leave this issue open, but I don't have the time to fix it now.

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