josm
josm copied to clipboard
Improve display names of route relations
This makes two changes:
- Include the type of a route in its display name, to easily distinguish e.g. hiking routes from cycling routes in the UI.
- For objects (not necessarily limited to routes) without a name or ref, but with a from and/or to attribute, use "from-to" in the display name.
The initial one seems like an clear improvement. The second one might need a bit more consideration (i.e. it adds a bit of a special case).
These changes were made when working with hiking routes in the Swiss hiking route network, but should be generally usable as well.
Is there any interest in merging this change? I'm in Switzerland again, and running into this issue again (routes that are nicely tagged with from and to, but then no longer easy to identify in josm). I'm resorting to adding note tags, but that's tagging for renderers, which isn't the best solution...
This is only a MIRROR! Report bugs/enhancements in https://josm.openstreetmap.de/!
To add on to what stoecker said, once you open a ticket on https://josm.openstreetmap.de, add a link from that ticket to this PR and add [PATCH] to the ticket title on the JOSM website. You should also either modify the title of this PR to have the ticket number in it or link back to the ticket from first post. This makes it easier to check and see if this PR has been merged, and will let someone close it if it got forgotten.
Please read https://josm.openstreetmap.de/wiki/DevelopersGuide/PatchGuide -- please note that I consider GitHub PR links to be good enough (add .patch to the URL), but other maintainers may not.
I also haven't checked your patch -- have you run ant pmd checkstyle and fixed the warnings?
Something that I will ask if you do not register on the ticket system (we do allow for "anonymous" tickets) is how you want the patch attributed, since we cannot merge patches from GitHub into SVN; this means that most patches from external patches have a (patch by <foo>) addendum to the first line of the commit message.
One of the reasons why we like to have bugs/feature requests filed on our system is just in case an external system decides to make life difficult for us; by having the tickets and (hopefully) most of the conversation on our own systems, we can refer back to that even if the external system is closed down.
I also tend to be a bit more verbose in the commit messages/code comments since those are much less likely to be accidentally destroyed, and they tend to go with all the mirrors of the code, but that won't cover all the conversation/why something was decided. Hopefully no one is cursing my name in 10 years for poorly documenting why I did something. :)
First off, thanks for taking your time to respond!
To add on to what stoecker said, once you open a ticket on https://josm.openstreetmap.de, add a link from that ticket to this PR and add
[PATCH]to the ticket title on the JOSM website. You should also either modify the title of this PR to have the ticket number in it or link back to the ticket from first post. This makes it easier to check and see if this PR has been merged, and will let someone close it if it got forgotten.
Seem I did that for an earlier PR, not sure why I did not do this here. Will do that now.
I also haven't checked your patch -- have you run
ant pmd checkstyleand fixed the warnings?
I'm not sure, will do so now.
Something that I will ask if you do not register on the ticket system
I registered an account, probably easier than filling in my details every time :-)
One of the reasons why we like to have bugs/feature requests filed on our system is just in case an external system decides to make life difficult for us; by having the tickets and (hopefully) most of the conversation on our own systems, we can refer back to that even if the external system is closed down.
Makes sense, thanks for explaining.
I also tend to be a bit more verbose in the commit messages/code comments since those are much less likely to be accidentally destroyed, and they tend to go with all the mirrors of the code, but that won't cover all the conversation/why something was decided. Hopefully no one is cursing my name in 10 years for poorly documenting why I did something. :)
Not sure if you looked at my commit messages yet, but I have the same tendency (this is also why I prefer a PR to patch files - easier to split changes into different commits and specify commit messages).
I also haven't checked your patch -- have you run
ant pmd checkstyleand fixed the warnings?
I went ahead and documented this at https://josm.openstreetmap.de/wiki/DevelopersGuide/PatchGuide?action=diff&version=12 (since I think pmd was not mentioned at all, and checkstyle only elsewhere).
@tsmock I've made the changes you suggested, and also fixed a small formatting bug (missing space) in a new commit. The code now passes ant checkstyle pmd test.
When making a ticket on trac about this, I noticed an existing related ticket: https://josm.openstreetmap.de/ticket/4596#comment:9 Discussion there (from a few years ago) suggested the use of presets with name templates instead of modifying the code, which I investigated and seems a reasonable alternative to the changes in this PR, but with some significant limitations as well. See the ticket for further details, probably good to continue discussion there before further considering the code in this PR.