GPX import failure after editing with QGIS

I used OSMAnd to create a .gpx track of a ride I completed recently. I then imported it into QGIS and converted it into a .shp file so that I could edit it easily.

After doing this I exported the .shp file back to .gpx and tried to upload it to openstreetmap.org, but the upload failed with the following message:

0 points parsed ok. Do they all have lat,lng,alt,timestamp?

I searched and read and found that gpxstarlet can add in timestamps, so I gave this a go:

xmlstarlet ed -N x=http://www.topografix.com/GPX/1/0 -N y=http://www.topografix.com/GPX/1/1     -s '//x:rtept|//y:rtept' -t elem -n time -v 1970-01-01T00:00:00Z 3sis.gpx > 3sis-starlet.gpx

The code seems to have worked (see below), but Iā€™m still getting the same failure message from OSM. Iā€™ve tried opening the same file on gpsprune and GoogleEarth and there are no problems. Iā€™m struggling to identify what is missing or incorrect about my .gpx file.

<?xml version="1.0"?>
<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ogr="http://osgeo.org/gdal" xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="GDAL 3.6.2" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
  <metadata>
    <bounds minlat="-12.437116524304225" minlon="130.866533007792299" maxlat="-12.433758299999999" maxlon="130.872691099999997"/>
  </metadata>
  <rte>
    <name>Three Sisters</name>
    <extensions>
  </extensions>
    <rtept lat="-12.43497112265297" lon="130.871051663345042">
      <ele>68.4</ele>
      <time>1970-01-01T00:00:00Z</time>
    </rtept>
    <rtept lat="-12.435003622652969" lon="130.871016963345056">
      <ele>67.0</ele>
      <time>1970-01-01T00:00:00Z</time>
    </rtept>
    <rtept lat="-12.43504972265297" lon="130.870964863345051">
      <ele>68.2</ele>
      <time>1970-01-01T00:00:00Z</time>
    </rtept>
  </rte>
</gpx>

I should add, Iā€™ve not seen anything online that explains what ā€˜altā€™ is.

I suppose alt = Altitude

1 Like

Maybe the uploader does some kind of sense check on the timestamps as well as checking they exist? A constant timestamp from 1970 at each point is not very plausible. But I donā€™t know for sure if that is the case.

As far as I remember the reason for the check is that uploaded traces are supposed to be original tracks you actually recorded in person, not tracks you later edited (or that mappers obtained from other random sources).

What kind of editing are you doing? Could you just upload the original file?

Note that editing the geometry could defeat one of the purposes of the gps traces which is to help align offset imagery.

2 Likes

The solution I used (that gives a constant timestamp) comes from the OSM Wiki (GPX - OpenStreetMap Wiki). So, Iā€™d assume that itā€™s okay to have a constant timestamp.

The editing I did was to remove some points and align the points better using aerial imagery, local maps and my own knowledge. I did this thinking it would be easier to edit the OSM map if I was using a gpx file that was exactly what I wanted the end path to look like. I have uploaded and worked off original files in the past, but my gps can be quite inaccurate (sometimes due to vegetation) which results in gpx files that canā€™t be completely relied upon for accuracy.

Iā€™m not sure what you mean in your last point. When editing OSM, sometimes imagery gives good indications of where paths go and other times the gpx file (or other sources) are the best option. But Iā€™ve only been doing this for a short time and donā€™t know all the inns and outs, so maybe Iā€™m missing something?

Yeah, makes sense. Itā€™s got ā€˜eleā€™ for elevation? Iā€™ll try changing the term.

Nope, replacing ā€œeleā€ with ā€œaltā€ made no difference.

So it does. Maybe there is some unrelated formatting problem. Or maybe that wiki page is outdated.

Then itā€™s not really a GPS trace any more. Itā€™s your intepretation of the path you followed. Which is fine for your own mapping, but arguably not what the public GPS database is for, as it is now a mix of several sources - real GPS plus whatever map or imagery you used.

Note that you can use your own GPS tracks in many OSM editors without uploading them to the public database. In fact thatā€™s what I regularly do myself. It seems like you have a multiple stage process (edit gpx in QGIS, upload public modified trace, edit map), where perhaps a single stage would be easier (load gpx locally in JOSM or ID, use it as a guide to edit map).

[quote=ā€œRingbarkis, post:4, topic:122397ā€]
Iā€™m not sure what you mean in your last point.
[/quote] Satellite imagery is generally not perfectly aligned to the real surface of the earth. Historically one of the uses of the public GPS traces has been to adjust for this - an average of several (individually imperfect) traces can help estimate the offset in a particular local area.

3 Likes

Just a glance seems to indicate that you are uploading route points and not track points in a track, afaik we only support the later.

4 Likes

That seems to have fixed it, thanks.

I also removed the ā€˜extensionsā€™ tags. So the final version looks like this:

<?xml version="1.0"?>
<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ogr="http://osgeo.org/gdal" xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="GDAL 3.6.2" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
  <metadata>
    <bounds minlat="-12.437116524304225" minlon="130.866533007792299" maxlat="-12.433758299999999" maxlon="130.872691099999997"/>
  </metadata>
  <trk>
    <name>Three Sisters</name>
    <trkseg>
    <trkpt lat="-12.43497112265297" lon="130.871051663345042">
      <alt>68.4</alt>
      <time>1970-01-01T00:00:00Z</time>
    </trkpt>
    <trkpt lat="-12.435003622652969" lon="130.871016963345056">
      <alt>67.0</alt>
      <time>1970-01-01T00:00:00Z</time>
    </trkpt>
    <trkpt lat="-12.43504972265297" lon="130.870964863345051">
      <alt>68.2</alt>
      <time>1970-01-01T00:00:00Z</time>
      </trkpt>
    </trkseg>
  </trk>
</gpx>

1 Like