Sometimes one might want to clean up some features in OSM - for example, untagged ways that are not members of any relations. Such ways sometimes are left behind by wide-sweeping but perhaps less careful changes to forests and other areas. If such ways are short, it’s easy - but if they are very large, downloading a huge area in JOSM is not the best approach.
As I tend to forget the process to do this, documenting it here.
Knowing the object (way) ID, we can use the “File -> Download object…” functionality (Ctrl/Cmd+shift+o):
That opens the object download dialogue, where the way ID is pasted and “Object type” is set to “way”:
After downloading the object, we could delete it and upload our changes… but with long ways it will likely fail, as some nodes from this way are used by other ways. Even though the object download dialog has a “Download referers” option, that only handles parent relations. There’s even an explicit note about this in the “Download object” documentation page.
So how could we also get all the ways that include any of the nodes in our way to be deleted?
- Select the way and choose “Selection -> Adjacent nodes” (e).
- Select “File -> Download parent ways and relations” (Ctrl+alt/opt+d).
Another option would be to use object downloading dialog in step two again - with nodes selected, it attempts to auto-populate the “Object ID” field (big thanks to kaptaptuka from #osm for this tip). Unfortunately, that fails with many nodes.