Hi. I want to search tagged nodes that aren’t only address nodes. - e.g. POIs with an address are fine, as well as nodes without any addr:*=*.
In essence:
take tags of the node
remove addr:housenubmer, addr:street, addr:city, source:addr (etc.) from the tag list
if there are any tags still left - then output the node.
It won’t. It works over whole elements (nodes, ways, relations), not tags.
Well, you could make an abomination like node["addr:housenumber"]["addr:street"](if: count_tags()==2); node["addr:housenumber"]["addr:street"]["addr:city"](if: count_tags()==3); and subtract that, but you would need to list every possible combination. With 10 or so keys that qualify as address-related it’s a recipe for a combinatorial explosion.
For the minus set we need to exclude the addr tags but I dont think that we can use the Not exist ! parameter with regular expressions like [~“addr:”].
An other solution is to list all the expected other tags like:
node[~"addr:"~"."]({{bbox}})->.all;
(
node.all[amenity]({{bbox}});
node.all[shop]({{bbox}});
node.all[office]({{bbox}});
);
out meta;
Actually knowing the length of a list I could make a regex on keys and then duplicate it, but still this is inelegant. Example for a reduced list of 3 tags addr:housenumber, addr:city, addr:street:
node[~"^(addr:housenumber|addr:city|addr:street)$"~".*"](if: count_tags()==1); node[~"^(addr:housenumber|addr:city|addr:street)$"~".*"][~"^(addr:housenumber|addr:city|addr:street)$"~".*"](if: count_tags()==2); node[~"^(addr:housenumber|addr:city|addr:street)$"~".*"][~"^(addr:housenumber|addr:city|addr:street)$"~".*"][~"^(addr:housenumber|addr:city|addr:street)$"~".*"](if: count_tags()==3);
Probably colons in regexes need escaping, haven’t tested that.
Well, that is also what I considered, such list would still be quite long and won’t cover everything.
The problem I want to solve is to check how many nodes are there that weren’t imported addresses. Making stats is quite easy afterwards.
Honestly seems I would have much more luck expressing what I want in PostgreSQL with osmosis-imported database in pgsnapshot schema. After all, hstore data type can be subtracted.
This seems to do what you need? (Though it might need some more tweaking, in case you don’t want results where the only other tag is source = survey or entrance = yes)