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

Exported tracks have malformed XML (in <hdop>) #683

Open
GideonBear opened this issue Oct 20, 2024 · 1 comment · May be fixed by #685
Open

Exported tracks have malformed XML (in <hdop>) #683

GideonBear opened this issue Oct 20, 2024 · 1 comment · May be fixed by #685
Labels
bug Something isn't working

Comments

@GideonBear
Copy link

Example of exported track:

<?xml version="1.0" encoding="UTF-8"?>
<gpx 
 xmlns="http://www.topografix.com/GPX/1/1" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
  <trk>
    <name>track_1</name>
    <trkseg>
     <trkpt lon="snip" lat="snip">
       <time>"snip"</time>
       <ele>"73.0"</ele>
       <hdop>"1.3">
     </trkpt>
     <trkpt lon="snip" lat="snip">
       <time>"snip"</time>
       <ele>"73.2"</ele>
       <hdop>"1.4">
     </trkpt>
    </trkseg>
  </trk>
</gpx>

Note the <hdop>"1.3"> line.

How to Reproduce

  1. Enable GPX notes
  2. Start a track
  3. Walk a bit
  4. Stop the track
  5. Press the GPX button
  6. Export all notes
  7. Unzip the notes.zip file
  8. The resulting track_1.gpx file is malformed.

I think the problem lies in the app/src/main/java/de/westnordost/streetcomplete/data/osmnotes/edits/NoteEditsController.kt file, which contains the exact wrong string that is output.
I think the fix is as simple as:

-                            "       <hdop>\"${it.accuracy}\">\n"
+                            "       <hdop>\"${it.accuracy}\"</hdop>\n"

I can make a PR if necessary.

Expected Behavior

A valid GPX file to be exported

Does it happen in normal StreetComplete?
The code I mentioned and the functionality for exporting GPX files do not exist in normal StreetComplete

Versions affected

Android 14
SCEE 59.2

@GideonBear GideonBear added the bug Something isn't working label Oct 20, 2024
@HolgerJeromin
Copy link

Yes, please make a pr

@GideonBear GideonBear linked a pull request Oct 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants