Search objects in the current data layer using query language. This tool have different look, depending on your expert setting:
Hover over keyword in search menu to get textual explanation with simple example!
| Expert mode off: ||.|
| Expert mode on: ||- standard/regular expression/MapCSS selector radio button, see sections below for details - add toolbar button covered in section [Help/Action/Search#SavesearchqueryinMaintoolbar]|
|Keyword||Supports ranges||Range separator||Description|
|id||yes||-||Search for objects with specific ids ([Help/Concepts/Object#Objectids])|
|version||yes||-||Search for objects with specific version ([Help/Concepts/Object#Objectversions]). version:0 is equivalent to keyword new. Note that version:-1 will match new objects.|
|type||no||n/a||Only 3 possible values: type:node, type:way, type:relation ([Help/Concepts/Object#NodesWaysRelations])|
|user||no||n/a||"anonymous" is a special word? i.e. user:anonymous|
|nodes||yes||-||Search for objects with number of nodes within range. Note that nodes:-2 query won't match single nodes!|
|tags||yes||-||Search for objects with tag count of tags within range, regardless of "discardable tags" and "uninteresting tags" ([Help/Concepts/Object#Tags]). Note that tags:-1 will also match tagless objects!|
|modified||no||n/a||Confusing name: will select (old and modified objects) or (completely new objects).|
|untagged||no||n/a||This modifier differs from tags:0 since it will ignore all "discardable" and "uninteresting tags" (description, attribution, source, source_ref, source:, comment, converted_by, watch, watch:,)! more info|
|timestamp||yes||/||min/max pair with two notes. If min timestap is empty: use lowest possible date (1980). If max timestamp is empty: use current time.|
Some examples of queries:
- type:way selects all ways
- name:Herrengasse selects all elements with the given name
- name=Herrengasse same as above, but case sensitive
- "name"="Baker Street" same as above, but works also with special characters like white spaces in the value
- tag1=yes tag2=yes is equivalent to tag1=yes & tag2=yes
- type:way name:- selects all ways that do not have a name
- id:123465678 selects an object (way or node) with a particular id
- timestamp:2010-11-01/2010-12-01 selects object with last change in November 2010
- See also Help/Dialog/Filter#Examples
Save search query in Main toolbar
To save search as a button if you check add toolbar button checkbox, as soon as you click on Start Search, a button will be added to the Main Toolbar. which will execute the defined search expression each time, you press the button.
As with any "button" you can always assign shortcut to it.
JOSM supports Java regex syntax.
Fetch external file and replace selection
A very under-used feature that lets you enter a web URL (file://, http://, https://, ftp://) in the search field.
JOSM will then attempt to load that URL, and select any objects that it finds referenced in that file. JOSM will look for XML tags "way", "node", and "relation" in the document (clarify? examples?), and use their id attribute . You can access another OSM file on your hard disk this way and have JOSM select all objects that are present in the file (provided they are present in JOSM's dataset too).
Similar thing is possible via command line parameter during JOSM start-up. Similar thing is possible via Remote control command.
- [Help/Dialog/Filter] allows you to save and combine multiple search patterns between your JOSM sessions
- Search.png (56.2 KB) - added by Klumbumbus 12 months ago.
- 9229-search-expert-true.png (30.6 KB) - added by openstreetmap.org-user-d1g 10 months ago.
- 9229-search-expert-false.png (18.8 KB) - added by openstreetmap.org-user-d1g 10 months ago.
- 9229-search-expert-false-with-tooltip.png (17.4 KB) - added by openstreetmap.org-user-d1g 10 months ago.
Download all attachments as: .zip