NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I am lost with a GPX file. It was recorded with Quick Position App, then the names were stripped and the way points replaced with track points following the requirement of OSM. I was first getting (trying to upload to osm.org) the most informative Found no good GPX points in the input data (the reason being that the original file contained way points only), and now it's Expected state TRACKPOINT, got state UNKNOWN XML parser at line 3 column 2. I am stuck and would appreciate help.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="matt" version="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">
        <ele>200.9063513539106</ele>
        <time>1990-04-27T14-56-57Z</time>
    </trkpt>
    <trkpt lat="54.55410358198684" lon="25.3773501871292">
    <trkpt lat="54.55414923144265" lon="25.377350253212516">
        <ele>201.31068553007708</ele>
        <time>1990-04-27T14-57-05Z</time>
    </trkpt>
    <trkpt lat="54.55458511446888" lon="25.37838106148478">
        <ele>221.71354527843178</ele>
        <time>1990-04-27T14-58-38Z</time>
    </trkpt>
    <trkpt lat="54.554818184474456" lon="25.378866436901745">
        <ele>224.6318238358151</ele>
        <time>1990-04-27T14-59-21Z</time>
    </trkpt>
    <trkpt lat="54.554907515743935" lon="25.379065394625034">
        <ele>224.77350879803234</ele>
        <time>1990-04-27T14-59-34Z</time>
    </trkpt>
</gpx>

asked 08 Aug '13, 23:06

Kotya's gravatar image

Kotya
631202536
accept rate: 0%

edited 09 Aug '13, 18:13

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554


The first trackpoint misses an begin tag and the second an end tag (that is no formally valid XML). I guess you swapped lines (line 6 should be line 3). The time format is wrong, too (apparently needs to be in ISO 8601 format). Maybe trk and trkseg elements are needed too (it seems they are not for uploading to OSM, thanks @Kotya for testing it, maybe they are for standard compatibility). You can check your XML file by uploading or pasting at http://validator.w3.org/ for formal errors. Suggestion:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="matt" version="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>
<trkseg>
    <trkpt lat="54.55410358198684" lon="25.3773501871292">
        <ele>200.9063513539106</ele>
        <time>1990-04-27T00:00:00Z</time>
    </trkpt>
        <trkpt lat="54.55414923144265" lon="25.377350253212516">
        <ele>201.31068553007708</ele>
        <time>1990-04-27T00:00:01Z</time>
    </trkpt>
    <trkpt lat="54.55458511446888" lon="25.37838106148478">
        <ele>221.71354527843178</ele>
        <time>1990-04-27T00:00:02Z</time>
    </trkpt>
    <trkpt lat="54.554818184474456" lon="25.378866436901745">
        <ele>224.6318238358151</ele>
        <time>1990-04-27T00:00:03Z</time>
    </trkpt>
    <trkpt lat="54.554907515743935" lon="25.379065394625034">
        <ele>224.77350879803234</ele>
        <time>1990-04-27T00:00:04Z</time>
    </trkpt>
</trkseg>
</trk>
</gpx>

Please delete such fake tracklogs (the connected waypoints make no sense I guess) after using it. By the way: with Potlatch2 or JOSM you do not need to upload a gpx. You can even use a local gpx file with real waypoints. Despite that feature the obligatory warning: uploading tracks(!) is useful for other people (averaging several traces to try to eliminate some gps errors) - so, please continue to upload real tracks (maybe only if not tooo bad reception quality/smartphone/bad gps receiver).

permanent link

answered 08 Aug '13, 23:18

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554
accept rate: 18%

edited 09 Aug '13, 18:09

Can I use a local file with Potlatch2? Could you explain how or give a link?

(08 Aug '13, 23:29) Kotya

Thanks for finding my stupid mistake. However, your code results in "Found no good GPX points in the input data. At least 75% of the trackpoints lacked a <time> tag." :) Any clue?

(08 Aug '13, 23:31) Kotya
1

Inserted link for Potlatch2. Fixed the time - did you break the precious gpx file in even more ways? ;-)

(08 Aug '13, 23:39) aseerel4c26 ♦

Well, it was not me! :) OSM does not like way points, and the app does not know the standards :) BTW, thanks for correcting my XML code formatting. I know the rules, but the preview here fails on the properly formatted code. So I "corrected" it to make sure you can at least see what I mean. Thanks for undoing it.

(09 Aug '13, 07:20) Kotya
1

BTW, the trk and trkseg elements are not needed. Apparently, I cannot edit your answer.

(09 Aug '13, 07:27) Kotya
1

Thanks for the report, I have added it (see faq about karma why you cannot edit my answer).

I hope you got the direct loading in Potlatch2 to work, too.

(09 Aug '13, 18:10) aseerel4c26 ♦
showing 5 of 6 show 1 more comments

You don't need to convert waypoints to trackpoints - leave the waypoints as is and add a fake track segment and track point corresponding to the first waypoint.

permanent link

answered 11 Aug '13, 15:07

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

1

Ah, yeah, indeed. I missed to mention that. However, if you only want to use the waypoints yourself (not for use by other mappers), then uploading waypoints is not needed at all - and therefore even more easy (no editing needed).

(11 Aug '13, 15:11) aseerel4c26 ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×255
×117
×69

question asked: 08 Aug '13, 23:06

question was seen: 5,141 times

last updated: 11 Aug '13, 15:11

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum