From OpenStreetMap Wiki
< JOSM‎ | Plugins
Jump to navigation Jump to search

The way selector plugin allows easy selection of sequential ways that have been divided into segments. It resembles the way downloader plugin but operates on already downloaded data.

A typical use is to select the mainland natural=coastline without selecting any islands or lakes.


  • Download and install the plugin into JOSM
  • Download or open a set of data in the normal way
  • Select one or more ways. You may also select other primitives than ways.
  • From the menu activate Tools-Way Select (or press Shift+W).
  • The selection of ways will be extended until the way ends or branches are encountered.

If you wish to extend the selection further, resolve the branches by adding the desired way or ways to the selection and activate the plugin again.


Originally created by User:Skela (Marko Mäkelä)

The jar:

The source code:

Ideas for Development

Allow search conditions for pruning uninteresting branches

Ways are often split at junctions because of route relation memberships. For example, given the condition highway=secondary, any highway=tertiary or highway=residential branches would be ignored when extending the selection of the highway=secondary. Or, if a street has been defined as two oneway streets, you could give the ref or name as the search condition and let the plugin select only one of the oneway streets.

Allow more generic selection operations

In residential areas, speed limits are often posted as area limits instead of per-way limits. It could be useful to have a function for selecting all ways that are connected to the selected ways and meet the specified condition, or another function for selecting all ways that are on the specified side of the currently selected ways, or enclosed by the currently selected ways. On the other hand, much of this can already be achieved by selecting an area and searching for matching ways in the selection.

Allow operations on multiple selections

It could be practical to save and restore named secondary selections from and to the primary selection. The secondary selections could be restored to the primary selection, or they could be combined to form further secondary selections, e.g., by union (OR), intersection (AND), subtraction (AND NOT), or exclusive-OR.

For example, one could select all natural=coastline ways and save that as a secondary selection. Then, clear the primary selection, select the mainland coastline with the plugin, and save the primary selection as another secondary selection. Then, subtract the selection of the mainland coastline from all natural=coastline ways, and save the result as a third secondary selection. Restore it to the primary selection, and you have the archipelago selected.