Opened 3 years ago

Closed 3 years ago

Last modified 3 years 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:


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&

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 , 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 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 years ago.

Download all attachments as: .zip

Change History (4)

Changed 3 years ago by skorbut

Attachment: keep_order.patch added

comment:1 Changed 3 years ago by Don-vip

Milestone: 17.12

comment:2 Changed 3 years 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 years ago by skorbut

The aforementioned patch for sorting the dialog's columns can be found at .

Modify Ticket

Change Properties
Set your email in Preferences
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.