#14923 closed enhancement (fixed)
[patch] JOSM search by preset in the search dialog
| Reported by: | bafonins | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | 17.07 |
| Component: | Core | Version: | |
| Keywords: | Cc: | michael2402 |
Description (last modified by )
Currently, there are two menu entries to perform searching - "Search" and "Search for object by preset...". And functionality to search for osm objects is very limiting, namely there is no way to search for two or more presets at the same time, it is not possible to add object that match the preset to the current selection and etc.
I propose to merge these dialogs, actually adding functionality to search for presets to the search dialog. Then queries like
preset:water | preset:waterway or
preset:Village | preset:"Cave Entrance" | highway=motorway
can be performed + the selection settings from the search dialog can be used to control selected objects.
Also, we can embed the "Search for objectsby preset..." dialog intro the "Search" dialog in order to simply select needed presets and append 'preset:...' query to the text field.
Attachments (8)
Change History (22)
by , 9 years ago
| Attachment: | preset-search..jpg added |
|---|
by , 9 years ago
| Attachment: | preset-search.patch added |
|---|
comment:1 by , 9 years ago
| Summary: | JOSM search by preset in the search dialog → [patch] JOSM search by preset in the search dialog |
|---|
comment:2 by , 9 years ago
| Description: | modified (diff) |
|---|
comment:4 by , 9 years ago
| Description: | modified (diff) |
|---|
comment:5 by , 9 years ago
| Milestone: | → 17.06 |
|---|
follow-up: 7 comment:6 by , 9 years ago
There is a github PR for this patch. Commenting is easier there. I did a review on it - especially to address some coding style issues:
follow-up: 8 comment:7 by , 9 years ago
Replying to michael2402:
There is a github PR for this patch. Commenting is easier there.
No it is not. It is already enough work to react to one bug-tracker. Starting to react to different places is not a good idea.
comment:8 by , 9 years ago
Replying to stoecker:
Replying to michael2402:
There is a github PR for this patch. Commenting is easier there.
No it is not. It is already enough work to react to one bug-tracker. Starting to react to different places is not a good idea.
For conceptional issues I agree. But my comments were more on stylistic issues (variable names, inverting equals, using blocks in if/else, ...)
@bafonins: You patch looks better that way ;-). Cann you add test cases to it to the SearchCompilerTest? Especially for:
`
preset:"water" (Test if it matches correctly)
preset:water (Test if it matches correctly)
preset: water (Test if it matches correctly)
preset: (Should throw a ParseError)
preset:xyz (Should throw a ParseError)
`
comment:9 by , 9 years ago
@bafonins: Should I merge this patch now or wait for your work on your future work?
comment:11 by , 9 years ago
| Milestone: | 17.06 → 17.07 |
|---|
Moving this until after the 17.6 release - the patch should be ready before then but we should have time to fix issues.
by , 9 years ago
| Attachment: | en-search-dialog-expert.jpg added |
|---|
The search dialog, expert mode, english
by , 9 years ago
| Attachment: | ger-search-dialog-exp.jpg added |
|---|
The search dialog, expert mode, german
comment:12 by , 9 years ago
With this update GUI of the search dialog changed a bit. New hints added, as well as a list of possible presets to search for.



After clicking on any preset in the selector, a corresponding string is generated and appended to the text field. Autocomplete is working and in case of selecting some preset that starts already used query, the generated part is selected. And of course, presets can be combined into more sophisticated queries as you usually do with types, names, logical operators, etc.
So, searching works as follows :
Annotation/Address - a regular query that matches all object that have the corresponding preset
Annotation/* - a wildcard query that matches all object that have any preset of the group Annotation
Any suggestions?
by , 9 years ago
| Attachment: | preset-search-v4.patch added |
|---|




Note before applying: Typo in the first line "all object_s_".