Or cool things about JOSM you didn't know existed.
- Got multiple objects on top of each other and can't see them properly? The middle-click mouse button displays a dialog with all the objects under the mouse (On Apple/Mac OS X, this ability varies with the mouse type. This does not appear to be possible with a one-button mouse. With the Mighty Mouse, the scroll ball can be configured as "Button 3" to make this work.)
- In addition to the prior trick, if you hold down the Control key (after you did the middle-click), it keeps the window, allowing you to select objects from the list. You may have to hold down the Alt key in addition to the Control key when selecting.
- If you hold down the ALT key while deleting a way, JOSM will keep the nodes of the way
- Use the command stack window to keep an eye on what's happening. It's very handy to noticing you've accidentally moved a way you didn't intend.
- You can look for mistyped tags by selecting everything (Ctrl-A) and then looking at the tag list. If you select a row and hit edit, the dropdown contains all the variations used. Don't actually hit OK here, that would change everything. Instead, use the Search tool to find the bad tags.
- JOSM's search function is very extensive. You can match on key:foo and value:bar. There are the keywords "selected" for currently selected objects, "modified" for things changed in this session and "incomplete". You can invert conditions by prefixing a minus and use the pipe symbol as an OR. For details see JOSM/Search function. Closely related: the filter function too hide some data.
- See what streets haven't been labeled - search for 'highway=* -name=*', and see what gets highlighted
- You've got an error message or a problem with a way/node and you only know an ID? Search for "id:<number>".
- Some window managers in linux (kde, enlightenment) catch the alt-mousebutton combination. This can be very disturbing if you want to create a new way that is attached to another one. This can be worked around by first clicking the mousebutton, then hitting alt, then releasing the mousebutton and then release alt. Sometimes you can also press another, unused, modifier together with alt to keep the window manager from grabbing it.
- If the default node-movement delay settings get annoying, they can be overridden with the advanced settings
edit.initial-move-delay(in milliseconds, defaults to
edit.initial-move-threshold(in pixels, defaults to
15). Both these can be entered using the "Einstein Tab" of the JOSM preferences panel.
- Got an .osm file from which you want to remove stuff? JOSM will normally not remove things but mark them with "action=delete" in the saved file. However, if you first change the file to use only negative IDs (sed -e 's/id="/id="-/' or similar), then JOSM will actually delete the items you delete, and write a reduced file when you save it. Alternatively, use XMLStarlet.
- Looking for the "invert selection" button? Use the "search" function and search for the expression "-selected".
- Save current session (if it takes 5 minutes to open all layers): in JOSM advanced preferences (expert mode), modify the "session" attribute into "true" (without the quotes), then restart.
- Create a URL of the current location that you're editing in JOSM by right-clicking on the longitude/latitude (found in bottom, left area of JOSM).
- Did you accidentally move a way and then realized you forgot where it originally went, and don't want to upload that change to the server? You can remove it from your local layer but NOT delete it from the server. To do this, select the way that you'd like to forget about, and press Ctrl+Shift+P. In JOSM, this is called purging.
- Did you want to change a bit of the appearance of the editor map? For example to highlight untagged nodes in highways which are no connections between different ways? Create a bit of your custom MapCSS style and insert into JOSM. Solution to the mentioned example. More on styles.
JOSM has built-in support for bookmarks covering a rectangular area. But what if you want to "bookmark" a complex shape?
- Manually download the data you want in multiple steps.
- Save to .osm file.
- Open .osm file in text editor, remove all nodes, ways, and relations, so that the remaining structure consists of one <osm> element and a number of <bounds> elements only.
- Keep this modified file in a safe location. Every time you want to download the area, open the file and select "update" from the File menu.
Fancy geometry tricks
Start off by setting up a sensible projection under Preferences → Map Settings, such as Mercator.
- Rotate objects: select everything you want to rotate, hold Shift+Ctrl and click-drag to rotate.
- Want to fix up a wobbly building up so all the angles are 90°? Highlight it and press "Q", the shortcut for the Orthogonalize built-in.
- Be sure you're using a projection like Mercator. If you use something like WGS84, then objects will be distorted when rendered.
- Doesn't matter what shape it is - could be "F"-shaped or a square - but it must be a closed way and have only two nodes per side (the angles must all be close to 90°, not 180°).
- You can do this with respect to a line. First highlight the building(s), then add exactly two other nodes to the selection to define the line against which everything must be aligned. Then hit "Q", and presto!
- Want to disentangle two or more ways that share the same node? Highlight the node and press "G", the shortcut for the unGroup built-in.
- You'll get lots of copies of the original node all in the same place. Be sure to merge any unwanted ones back together.
- If you also select one of the ways which share the node(s) before unGrouping, then after the unGroup the selection will be replaced with one containing just the copies which ended up in the way you selected.
Handy search strings
- If you just drew a bunch of ways and want to quickly select a portion of them so you can tag them i.e. highway=path in one go, then search for untagged type:way inview.
- To select ways you modified based on a different source than the original use this: source (modified | new | user:myself)
- If you modified a piece of coastline and want to remove all the original source and created_by tags on those nodes you moved, select that piece of coastline and do pgs modified child selected allindownloadedarea