Modify

Opened 3 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#15704 closed enhancement (fixed)

[PATCH] Keep order of tags added by 'addtags=' query parameter

Reported by: skorbut Owned by: team
Priority: normal Milestone: 17.12
Component: Core remotecontrol Version:
Keywords: Cc:

Description

If one adds tags using the query parameter addtags=, they inherently have an order. This order might be or might not be relevant to the user of JOSM. When the "Add tags to selected objects" dialog is used, the order of the tags gets lost due to the usage of the type HashSet<> in the class AddTagsDialog. (This is not only a theoretical issue, tags get indeed reordered seemingly randomly.)

Example: http://localhost:8111/load_and_zoom?select=currentselection&bottom=46.840191627005915&top=46.84039162700592&left=9.654214585876465&right=9.654514585876464&addtags=addr%3Astreet%3DFatsch%C3%A8l%7Caddr%3Apostcode%3D7028%7Caddr%3Acity%3DSt.%20Peter%7Caddr%3Acountry%3DCH%7Ccontact%3Aemail%3Dmail%40sporthoteltanne.ch%7Ccontact%3Aphone%3D%2B41%2081%20374%2016%2085%7Ccontact%3Afax%3D%2B41%2081%20374%2016%2086%7Ctourism%3Dhotel%7Cname%3DHotel%20Tanne%7Ccontact%3Awebsite%3Dhttp%3A//www.sporthoteltanne.ch&changeset_source=TOMAS-GR%20%282017-10-22%29

This simple patch keeps the order of the tags by using the type LinkedHashSet<> instead. Therefore the creator of the remotecontrol URL can control, in which order tags are shown to the JOSM user.

Why is this useful? Given a site such as http://demo.tlab.ch/tomas-gr , tags might be shown to the JOSM user a second time, independently of JOSM. By keeping the tag order, it is easier for the user to compare the two lists of tags. [*] If instead the order of tags doesn't matter to the user, this patch doesn't make things worse.

Why not sort them alphabetically? We don't know if this is what the user wants/expects. The tags might be sorted by some definition of importance. However, I plan to create and submit another patch, which lets the user sort the list of tags in the dialog by "Key", "Value" and "Existing values".

[*] Note that the order of tags shown at http://demo.tlab.ch/tomas-gr is currently not the same as the order of tags placed into the remotecontrol URL.

Attachments (1)

keep_order.patch (1.1 KB) - added by skorbut 3 weeks ago.

Download all attachments as: .zip

Change History (4)

Changed 3 weeks ago by skorbut

Attachment: keep_order.patch added

comment:1 Changed 3 weeks ago by Don-vip

Milestone: 17.12

comment:2 Changed 3 weeks ago by Don-vip

Resolution: fixed
Status: newclosed

In 13258/josm:

fix #15704 - Keep order of tags added by 'addtags=' query parameter (patch by skorbut)

comment:3 Changed 3 weeks ago by skorbut

The aforementioned patch for sorting the dialog's columns can be found at https://josm.openstreetmap.de/ticket/15705 .

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.