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

waypoint/trackpoint elevation not stored #274

Open
fkv1 opened this issue Sep 15, 2022 · 1 comment
Open

waypoint/trackpoint elevation not stored #274

fkv1 opened this issue Sep 15, 2022 · 1 comment

Comments

@fkv1
Copy link

fkv1 commented Sep 15, 2022

Menu "File" -> "Save as..." does not store the elevation (ele tag) of waypoints and trackpoints from imported GPX files into the .mdc file. This is not crucial (the GPX file can be imported again), and the removal of the elevations saves a tiny amount of disk space, but I don't believe it happens on purpose. It rather looks like a bug.

@Krakonos
Copy link
Member

This is a bug.

The cause is the TrackNode inherits from the generic Node class and adds the elevation property. But since it's not a tag in the sense of OSM, it is handled separately (in a similar fashing as coordinates are). Saving should not be a problem, implementing the proper toXML() method will take care of it. Reading it back will be a bit challenging, since it is currently squished with a regular node. The file format will likely have to be extended. Other option is to include the elevation as a special tag, but that would require some magic to convert all nodes with this tag to a TrackNode instances.

None of that is too difficult, but will possibly break compatibility. I may give it a try, but also if someone wants to pickup the task, I'd be happy to merge a PR. I suggest to:

  • Create a test for reading/writing OSM objects (just fragments like <node />, not whole files, that would require Document class instance, but that is a bit too difficult to create standalone).
  • Make sure the current samples load fine.
  • Implement write, add to tests.
  • Implement read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants