Open westnordost opened 3 years ago
This wasn't implemented for performance reasons, as it would be prohibitively expensive. I would have to look up a reference to a previous discussion on this topic if needed.
I could find some discussion on this topic in https://github.com/drolbr/Overpass-API/issues/59#issuecomment-55022401, but I don't find the performance hint anymore...
Ok, I understand
Ah wait, but perhaps as an evaluator in an if condition?
if: hasTagLike("^recycling:.*$")
Evaluators don't support any regular expressions at this time...
Ok. But if they do in the future, that might be a thing to consider.
I further worked on the "element filter syntax" used by StreetComplete by the way and found that for everything I need to conveniently support these extensions exists in OQL 👍
Found this commit: the XML query language rejects regular expressions on keys w/ negation: https://github.com/drolbr/Overpass-API/commit/7209dd399b8abfadbc8f413cb914ac0c0be81d35
Just wanted to mention that you would typically use a difference statement in this case:
(nwr[recycling]->.a; - nwr.a[~"^recycling:."~"."];);
out meta center;
Yes, this is how I currently do it
Yeah, I know :) this was meant as hint to people who found this issue via some web search.
I do not see any inevitable performance problem here. When other conditionals restrict the result set or the expression is sufficiently broadly (think of way[!~"."~"."]
, finding all ways without any tag) then it is probably fine.
It is just not a high priority.
Prototype implementation is here for testing: https://overpass-turbo.eu/s/1ko6
What already exists is
[!key]
and[~kexRegex]
. What is missing is[!~keyRegex]
or similar to check if an element has no key that matches with the regex tagged.Example use cases:
[!~'^recycling:.*$']
.!~'^cycleway(:left|:right|:both)?$'