JOSM/Advanced Tricks

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — JOSM/Advanced Tricks
English polski

  1. 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.)
  2. 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.
  3. If you hold down the ALT key while deleting a way, JOSM will keep the nodes of the way
  4. 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.
  5. 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.
  6. 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.
  7. 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 200) and edit.initial-move-threshold (in pixels, defaults to 15). Both these can be entered using the "Einstein Tab" of the JOSM preferences panel.
  8. 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.
  9. 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.
  10. 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).
  11. 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.
  12. 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.
  13. Do you feel that manually sorting relation member ways (e.g. for bicycle routes) is too slow and dull? JOSM has an automatic sorting built-in! Use the "A-Z" button in the relation editor window! Of course, take care to not mess up parts of the relation which you do not want to touch … You could also only sort a selection of relation members: select some relation members in the left list first. Getting that selection right also works by selecting ways on the map and then using the "← selection" button in the relation editor window or by selecting ways on the map first and then starting the relation editor.

Irregular Bookmarks

JOSM has built-in support for bookmarks covering a rectangular area. But what if you want to "bookmark" a complex shape?

  1. Manually download the data you want in multiple steps.
  2. Save to .osm file.
  3. 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.
  4. 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.

  1. Rotate objects: select everything you want to rotate, hold Shift+Ctrl and click-drag to rotate.
  2. Want to fix up a building with irregular angles 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!
  3. 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

  1. See what streets haven't been labeled - search for 'highway=* -name=*', and see what gets highlighted
  2. Looking for the "invert selection" button? Use the "search" function and search for the expression "-selected".
  3. 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.
  4. 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.
  5. You've got an error message or a problem with a way/node and you only know an ID? Search for "id:<number>".
  6. To select ways you modified based on a different source than the original use this: source (modified | new | user:myself)
  7. 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