Hello, with overpasss-turbo I want to query different names. Problem is: I don't know exactly which key/tag/feature the name has (I mean that I don't know if it's the name of a "natural:peak" or a "natural:glacier" or a "place:region" etc). But what I know is, that not all keys/tags/features should be searched (for example I know that it's not the name of a building, a bus stop or a highway). I figured out how to query a name e.g. as peak or glacier, as both are natural features:
But how can I query a name for example in region and peak? I tried different versions of concatenating these expression together according to the expression above with "|" like e.g.:
But this doesn't work (obviously). Is there a way to concatenate different keys/tags/features as expression together? Or do I really need to ask each name for each key individually like:
Thank you very much in advance for all your help :-) Best regards asked 19 Feb '20, 15:52 4Kala |
To get the union of several queries at once, you can group the query statements inside parentheses like this:
Another useful technique is to specify only the key and not the value, like this:
This will return anything tagged with You can also search just by name without any additional tags:
But you might end up finding, for example, a restaurant whose name contains "Dreitorspitze" (though it doesn't appear any such restaurant is currently on the map.) answered 19 Feb '20, 16:34 jmapb |
To apply 2 sets of conditions, use a named set for the output of the first set of features: http://overpass-turbo.eu/s/QSl
You probably want to go in the other direction, querying by name and then filtering on feature, but that should work fine. answered 19 Feb '20, 21:45 maxerickson |
Please consult the documentation If you want to search for a single value then use the equal sign:
If you want to search for lists of values then you can use a list as regular expression:
Other variants exist, depending on the exact aim. If you want to combine multiple criteria per or then use parentheses, as maxerickson has just explained. Finally, you can use as extra criteria also free-form logic
Please note that there is currently no node with name answered 20 Feb '20, 04:35 Roland Olbricht |
Thanks jmapb for your quick answer. This will save me several lines of code :-) so, if I understand you right, its not possible to search for something like:
The possibility to search a key without value is also very interesting, thanks very much. I just tried, if these could be concatenated, but also failed with different version of a code like this (there is no error message, but the map is empty):
As I need to query several hunderts of names I try to find a query with as less code as possible. So would there be a way to query each name just one time within several keys/tags/features (as a matter of fact I think - as jmapb suggested - the key without the value would be enough)? So something like this:
Thanks very much again :-) Edit: just saw our edit now: the problem with a query without additional tags is, that there would be too much results. And because I know for sure, that it's not the name for e.g. a restaurant, I would like to limit the query to the possible features. answered 19 Feb '20, 17:00 4Kala |
Thank you very much for your answers maxerickson and Roland Olbricht :-) With the help of you all I found the solution I need:
Thats what I was looking for, because I can generate this query automatically for all needed names and can query for specific keys/tags/features. Thank you all three very much again for your help :-) answered 20 Feb '20, 10:34 4Kala |