Why is my GPS trace not uploading?

,

Can anyone help me get a GPS trace uploaded?

I’m using an export from outdooractive.com. I’ve used these twice before and it’s been ok (see here). This one fails but I haven’t changed my process.

I’ve tried uploading several times with different tweaks. The last time I carefully followed the structure given at https://wiki.openstreetmap.org/wiki/GPX#Why_didn’t_my_GPX_file_upload_properly? (which meant stripping out a lot of metadata and putting the lines in a different order, tho I doubt that’s made any difference?)

The file looks like this:

<?xml >
<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.topografix.com/GPX/1/1"  
version="1.0" creator="outdooractive – http://www.outdooractive.com" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" 

  <time>2023-08-08T07:55:04.732</time>
  <trk>
    <name>Netherton & Bretton survey 7 August 2023 at 18:54</name>
    <trkseg>
      <trkpt lat="52.58152" lon="-0.268083">
        <ele>26.97107</ele>
        <time>2023-08-07T17:54:11.000Z</time>
      </trkpt>
      <trkpt lat="52.58149" lon="-0.268089">
        <ele>26.99752</ele>
        <time>2023-08-07T17:54:13.000Z</time>
      </trkpt>

(and continues for hundreds of points)

Error message to my email is:

Fatal error: Malformed declaration expecting version at :1. /srv/[www.openstreetmap.org/rails/config/initializers/libxml.rb:4:in](http://www.openstreetmap.org/rails/config/initializers/libxml.rb:4:in) `block in <main>' /srv/[www.openstreetmap.org/rails/lib/gpx.rb:16:in](http://www.openstreetmap.org/rails/lib/gpx.rb:16:in) `read' /srv/[www.openstreetmap.org/rails/lib/gpx.rb:16:in](http://www.openstreetmap.org/rails/lib/gpx.rb:16:in) `parse_file' /srv/[www.openstreetmap.org/rails/lib/gpx.rb:58:in](http://www.openstreetmap.org/rails/lib/gpx.rb:58:in) `rescue in points' /srv/[www.openstreetmap.org/rails/lib/gpx.rb:46:in](http://www.openstreetmap.org/rails/lib/gpx.rb:46:in) `points' /srv/[www.openstreetmap.org/rails/app/models/trace.rb:214:in](http://www.openstreetmap.org/rails/app/models/trace.rb:214:in) `each' /srv/[www.openstreetmap.org/rails/app/models/trace.rb:214:in](http://www.openstreetmap.org/rails/app/models/trace.rb:214:in)

(continues for hundreds of lines!)

Thanks.

Hi,

I see two errors in the declaration lines:

should be:

<?xml version="1.0" encoding="UTF-8"?>

The version is explicitly missing in the error messages:

Fatal error: Malformed declaration expecting version at :1.

is missing the ending > character. It should be

<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.topografix.com/GPX/1/1"  
version="1.0" creator="outdooractive – http://www.outdooractive.com" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">

instead.

1 Like

Thanks, especially because I am not a techie, and this meant nothing to me!
Will try your edits.

I tried your edit and got another error: it seems that when I try to take out metadata that personally identifies me, I always break the file.

So I downloaded the original and substituted metadata instead of removing it. It worked.

I’ve identified that it worked because - by chance - this time I didn’t use an ampersand (&) in the route name (neither at <trk> nor at <metadata>).

This is an issue hinted at in the wiki article in the OP, but there it refers only to & in waypoints. As my file had no waypoints, I didn’t think that was the issue.

I will update the wiki page. Thanks for your help!

1 Like

Yes I missed that :frowning:
I just exported an Strava activity of mine with an ampersand in the name as gpx. It was converted to

<name>Search &amp; found </name>

by Strava at export, or by OSM at import?

By Strava export. The export is creating a valid gpx file.

If I change the name part in an exported file

from

<name>Search &amp; found </name>

to

<name>Search & found </name>

then the result is an invalid gpx file and the import in OSM will fail with similar error messages as you got.

2 Likes