Modify

Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#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.

#16963#comment:23

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 in reply to:  description Changed 6 months ago by Don-vip

Replying to Bjoeni:

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).

Please contact them first, see https://github.com/openstreetmap/openstreetmap-website/issues/2046

comment:2 Changed 6 months ago by Bjoeni

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 Changed 6 months ago by Bjoeni

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 Changed 6 months ago by Bjoeni

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

     
    615615                        break;
    616616                    default: // Do nothing
    617617                    }
    618                     if (!noDraw && !segment.isUnordered() && (maxLineLength == -1 || dist <= maxLineLength)) {
     618                    if (!noDraw && (!segment.isUnordered() || !data.fromServer) && (maxLineLength == -1 || dist <= maxLineLength)) {
    619619                        trkPnt.drawLine = true;
    620620                        double bearing = oldWp.getCoor().bearing(trkPnt.getCoor());
    621621                        trkPnt.dir = ((int) (bearing / Math.PI * 4 + 1.5)) % 8;

comment:6 Changed 6 months ago by GerdP

Yes, looks good.

comment:7 Changed 6 months ago by GerdP

Resolution: fixed
Status: newclosed

In 15001/josm:

fix #17596: No lines displayed for GPX tracks without tags
Patch by Bjoeni

comment:8 Changed 6 months ago by Don-vip

Milestone: 19.04

@Gerd: please set milestone when you fix a ticket.

comment:9 Changed 6 months ago by GerdP

@Vincent: I promise improvement

comment:10 Changed 6 months ago by Klumbumbus

Little helper: https://josm.openstreetmap.de/report: {16} Resolved Core tickets without milestone

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.