ToniE
(Toni Erdmann)
April 10, 2026, 4:46pm
1
How can I escape the ‘|’ in the “key=value” pairs for the ‘addtags’ parameter?
The following remote control command does not work: the value of the tags include ‘|’
http://127.0.0.1:8111/load_object?new_layer=false&relation_members=true&objects=r1549761&addtags=gtfs%3Aroute_id%3Dde%3Amvv-muenchen%3A19-210%7C210%7CRegionalBus%3A1179_3%7Cgtfs%3Atrip_id%3Asample%3Dde%3Amvv-muenchen%3A19-210%7C210%7CRegionalBus%3A1179-1-1-H-0-We%233-320-333
with expanded %xx:
http://127.0.0.1:8111/load_object?new_layer=false&relation_members=true&objects=r1549761&addtags=gtfs:route_id=de:mvv-muenchen:19-210|210|RegionalBus:1179_3|gtfs:trip_id:sample=de:mvv-muenchen:19-210|210|RegionalBus:1179-1-1-H-0-We#3-320-333
The ‘|’ is the separator for this ‘addtags’ parameter used for adding multiple key=value pairs
I tried several things to “escape” the ‘|’, but neither worked
Woazboat
(Woazboat)
April 10, 2026, 5:10pm
2
Doesn’t look like there is a way to escape it unfortunately. The url parameter is first split at | characters, then parsed into key=value tags via the (.*?)=(.*?) regex. There’s no way to escape | characters as far as I can tell.
https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java#L286
ToniE
(Toni Erdmann)
April 10, 2026, 5:23pm
3
Thanks, also for pointing to the code.
What remains? Do not add those key=value pairs to the addtags parameter which include |.
So: no injection of DE-BY-MVV GTFS data into OSM route_master/route relations.
Woazboat
(Woazboat)
April 10, 2026, 5:43pm
4
The code could(/should) be changed to allow escaping/quoting special characters. I don’t see another way around that.
Looks like there’s already an open ticket for that problem, but it hasn’t had any activity.
ToniE
(Toni Erdmann)
April 10, 2026, 8:52pm
5
Thanks for the link. I’ve added a comment.
1 Like
ToniE
(Toni Erdmann)
April 11, 2026, 11:59am
6
I implemented a work-around in PTNA
Based on a missing feature / a bug in JOSM’s remote control interface, PTNA cannot inject data into route_master or route relations which include the pipe symbol ‘|’.
As a work-around, PTNA suppresses this data and gives a hint.
Please re-load pages with Ctrl-R or Ctrl-F5
[grafik]
Mouse-over the yellow string shows a hint: “String includes ‘|’”
Mouse-over the injection needle shows which tags get added and which not.
Related to #14490 (Support for escaping pipe character in remote control…
offen 11:45AM - 11 Apr 26 UTC
geschlossen 11:49AM - 11 Apr 26 UTC
bug
The pipe symbol is use in the URL to separate several key=value pairs in the add… tags parameter of the load_object remote command of JOSM
https://josm.openstreetmap.de/ticket/14490
ToniE
(Toni Erdmann)
May 11, 2026, 9:57am
7
There’s a fix in JOSM and PTNA
I just fixed a bug which actually was an issue in JOSM https://josm.openstreetmap.de/ticket/14490
handling ‘|’, the pipe symbol in data which shall be injected into route_master or route relations
currently seen only with DE-BY-MVV
This works now if you install at least JOSM version 19573 (which is currently included in josm-latest only)
ptna josm
1 Like