| | 18 | == Expert mode ==#ExpertMode |
| | 19 | In [wikitr:/Help/ExpertMode expert mode], the following options are added: |
| | 20 | * more keywords are listed (they work also in non-expert mode, but are hidden in the dialog) |
| | 21 | * **standard/regular expression/MapCSS selector** radio button, see sections below for details |
| | 22 | * **all objects** check box to include **''deleted''** and **''incomplete''** objects in the search |
| | 23 | * **add toolbar button** see [wikitr:/Help/Action/Search#SavesearchqueryinMaintoolbar save search query in main toolbar] below. |
| 17 | | || Keyword || Supports ranges || Range separator || Description || |
| 18 | | || id || yes || - || Search for objects with specific ids ([Help/Concepts/Object#Objectids]) || |
| 19 | | || 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. || |
| 20 | | || type || no || n/a || Only 3 possible values: `type:node`, `type:way`, `type:relation` ([Help/Concepts/Object#NodesWaysRelations]) || |
| 21 | | || user || no || n/a || "anonymous" is a special word? i.e. `user:anonymous` |
| 22 | | || role || || |
| 23 | | || changeset || yes || - || || |
| 24 | | || nodes || yes || - || Search for objects with number of nodes within range. Note that `nodes:-2` query won't match single nodes! || |
| 25 | | || ways || || |
| 26 | | || 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! || |
| 27 | | || areasize || || |
| 28 | | || waylength || || |
| 29 | | || modified || no || n/a || Confusing name: will select (old and modified objects) or (completely new objects). || |
| 30 | | || selected || || |
| 31 | | || incomplete || || |
| 32 | | || 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:,)! [https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java#L678 more info] || |
| 33 | | || closed || || |
| 34 | | || new || || |
| 35 | | || indownloadedarea || || |
| 36 | | || allindownloadedarea || || |
| 37 | | || inview || || |
| 38 | | || allinview || || |
| 39 | | || 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. || |
| 40 | | || nth || || |
| 41 | | || nth% || || |
| 42 | | || hasRole || || |
| 43 | | || parent || || |
| 44 | | || child || || |
| 45 | | |
| 46 | | == Examples == |
| 47 | | |
| | 27 | == Examples ==#Examples |
| 60 | | There is also a very under-used and under-documented feature that lets you enter a web URL (`file://`, `http://`, `https://`, `ftp://`) |
| 61 | | 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 |
| 62 | | look for XML tags "way", "node", and "relation" in the document, and use their id attribute. This means you can |
| 63 | | 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). |
| | 40 | == Save search query in [wikitr:/Help/MainToolbar main toolbar] ==#SavesearchqueryinMaintoolbar |
| | 41 | To ''save search as a button'' if you check **add toolbar button** checkbox, as soon as you click on [[JOSMImage(dialogs/search)]] **Start Search**, a button will be added to the main toolbar. which will execute the defined search expression each time, you press the button. |
| | 42 | |
| | 43 | * [[JOSMImage(preferences/toolbar,link=,24,middle)]] [wikitr:/Help/Preferences/Toolbar#Previouslysavedsearchresults Toolbar Customization] will let you modify icon, search query and tooltip. |
| | 44 | * As with any button you can always assign a shortcut to it in [[JOSMImage(preferences/shortcuts,link=,24,middle)]] [wikitr:/Help/Preferences/Shortcuts Shortcut Preferences]. |
| | 45 | |
| | 46 | == Regular expressions == |
| | 47 | JOSM supports [https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html Java regex syntax]. |
| | 48 | |
| | 49 | == MapCSS syntax == |
| | 50 | See [wikitr:/Help/Styles/MapCSSImplementation MapCSS implementation] |
| | 51 | |
| | 52 | == Fetch external file and replace selection ==#Fetchexternalfileandreplaceselection |
| | 53 | A very under-used feature that lets you enter a web URL (`file://`, `http://`, `https://`, `ftp://`) in the search field. |
| | 54 | |
| | 55 | * JOSM will then attempt to load that URL, and select any objects that it finds referenced in that file. |
| | 56 | * JOSM will look for XML tags "way", "node", and "relation" in the document (clarify? examples?), and use their id attribute . |
| | 57 | * 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). |
| | 58 | |
| | 59 | Similar thing is possible via: |
| | 60 | * [wikitr:/Help/CommandLineOptions Command line parameter] during JOSM start-up |
| | 61 | * [wikitr:/Help/Preferences/RemoteControl Remote control] command |