#17596 closed defect (fixed)
[Patch] No lines displayed for GPX tracks without tags
Reported by: | Bjoeni | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 19.04 |
Component: | Core | Version: | latest |
Keywords: | regression gpx conversion renderer | Cc: |
Description
Regression of #16963: Lines for local track segments without tags (timestamps/name etc) aren't drawn, only the individual trackpoints are visible.
The Gpx standard clearly states
A Track Segment holds a list of Track Points which are logically connected in order. To represent a single GPS track where GPS reception was lost, or the GPS receiver was turned off, start a new Track Segment for each continuous span of track data.
so the data returned by the server is completely invalid, but pretty much all the other files on this planet still follow the standard. And there are plenty of reasons for tracks without timestamps, including privacy and artificially created ones (to display a route).
I see two options:
- The OSM website guys actually care about the GPX standard and create an extension that allows them to add unordered points to a GPX file (I don't really see this happening, though I haven't contacted them). They could also create a new segment for each point but that would probably result in too big files.
- We only define segments as unordered when the file is coming from an OSM server (so essentially a hack... because our own system breaks the standard).
Also noted in #2760#comment:15
It seems "Convert to GPX layer" doesn't fully work. When I convert an untagged way only the GPX points are displayed This changes when I add a name tag to the way before converting. Seems to be a problem in the renderer as the TrkSeg information is not lost when I safe the converted layer to file.
Attachments (0)
Change History (10)
comment:1 by , 6 years ago
comment:2 by , 6 years ago
I can do that - but the point of this ticket was actually JOSM not following the standard for local files and therefore not displaying them correctly.
And the reason I wrote that I don't see this happening is because it would probably break all other software relying on the API - GPX extensions are not there to override the standard but to extend it. So the points couldn't be in a <trkseg>
anymore. But I'll open a ticket there and we'll see.
Until then I would still suggest fixing it in JOSM. If I remember correctly we do have the information if it came from an OSM server in the layer (even for saved and reopened files through <josm:from-server>
) so I guess it shouldn't be a big deal.
comment:4 by , 6 years ago
As expected, nothing's gonna happen on their end. Simon modified the API description to say "In violation of the GPX standard when downloading public GPX traces through the API, all waypoints of non-trackable traces are randomized". Brings back memories of Internet Explorer.
We're back to
We only define segments as unordered when the file is coming from an OSM server
comment:5 by , 6 years ago
Summary: | No lines displayed for GPX tracks without tags → [Patch] No lines displayed for GPX tracks without tags |
---|
Only had a quick look at it, but this should fix it.
-
src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
615 615 break; 616 616 default: // Do nothing 617 617 } 618 if (!noDraw && !segment.isUnordered() && (maxLineLength == -1 || dist <= maxLineLength)) {618 if (!noDraw && (!segment.isUnordered() || !data.fromServer) && (maxLineLength == -1 || dist <= maxLineLength)) { 619 619 trkPnt.drawLine = true; 620 620 double bearing = oldWp.getCoor().bearing(trkPnt.getCoor()); 621 621 trkPnt.dir = ((int) (bearing / Math.PI * 4 + 1.5)) % 8;
comment:10 by , 6 years ago
Little helper: https://josm.openstreetmap.de/report: {16} Resolved Core tickets without milestone
Replying to Bjoeni:
Please contact them first, see https://github.com/openstreetmap/openstreetmap-website/issues/2046