#18494 closed enhancement (fixed)
[RFC PATCH] GPX layers should use the name from the file instead of `Downloaded GPX Data` whenever possible
Reported by: | taylor.smock | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 20.01 |
Component: | Core | Version: | |
Keywords: | gpx | Cc: |
Description (last modified by )
Right now it is not possible to set the name of a GPX layer on download. This means that GPX layers are commonly called Download GPX Data
. It would be nice, if there is a name
in the metadata
, if JOSM could use that instead.
Use cases:
Tasking Managers could send an XML file that looks like this:
This XML file does not appear to have any style information associated with it. The document tree is shown below. <gpx creator="HOT Tasking Manager" version="1.1"> <metadata> <link href="https://github.com/hotosm/tasking-manager"> <text>HOT Tasking Manager</text> </link> <time>2019-12-31T21:56:28.586152</time> <name>Tasking Manager: Project 1, Task 1</name> </metadata> <trk> <name>Task for project 1. Do not edit outside of this area!</name> <trkseg> <trkpt lat="39.070328" lon="-108.561121"/> <trkpt lat="39.070438" lon="-108.571025"/> <trkpt lat="39.077663" lon="-108.57099"/> <trkpt lat="39.077499" lon="-108.56091"/> <trkpt lat="39.070328" lon="-108.561121"/> </trkseg> </trk> <wpt lat="39.070328" lon="-108.561121"/> <wpt lat="39.070438" lon="-108.571025"/> <wpt lat="39.077663" lon="-108.57099"/> <wpt lat="39.077499" lon="-108.56091"/> <wpt lat="39.070328" lon="-108.561121"/> </gpx>
Please note that the current version of the tasking manager (TM3) creates an empty layer with the desired name and then loads in the GPX file.
Attachments (3)
Change History (10)
by , 5 years ago
Attachment: | 18494.patch added |
---|
comment:1 by , 5 years ago
Summary: | [PATCH] GPX layers should use the name from the file instead of `Downloaded GPX Data` whenever possible → [RFC PATCH] GPX layers should use the name from the file instead of `Downloaded GPX Data` whenever possible |
---|
As I was writing the test, I noticed that the default name comes from the file name.
What should be preferred? Name from file name, or name from the metadata? I (think) name from file name should be preferred, but it will make it harder to write a test case.
by , 5 years ago
Attachment: | 18494.1.patch added |
---|
Move newLayerName
logic to getLayerName
function. Also, remove a pointless call in GpxLayer
(super(nameInFile); setName(name);
, where the super
call essentially sets the name is pointless).
comment:2 by , 5 years ago
Description: | modified (diff) |
---|
follow-up: 4 comment:3 by , 5 years ago
I would say file name should have priority over metadata. An advanced property that inverts this behaviour would be okay if you think it's worth it.
comment:4 by , 5 years ago
Replying to Don-vip:
I would say file name should have priority over metadata. An advanced property that inverts this behaviour would be okay if you think it's worth it.
I don't think it would be worth the added complexity. I'd pretty much have to have two branches, both doing essentially the same thing, but with the order reversed.
by , 5 years ago
Attachment: | 18494.2.patch added |
---|
Add advanced config variable to use meta data name over filename
comment:5 by , 5 years ago
Milestone: | → 20.01 |
---|
Initial patch (no tests)