I'm trying to combine 2 features of the OSM overpass flavor : if statement + regular expression.
Example :
[out:json][timeout:50];
area["name"="Paris"][admin_level=8]->.searchArea;;
(
node(area.searchArea)
["addr:housenumber"]["addr:postcode"]
[!"contact:email"]
[!"contact:phone"]
[!"phone"]
[!"email"]
[!"ref:FR:SIRET"]
[!"landuse"]
[!"amenity"]
[!"leisure"]
[!"website"]
[!"shop"]
[!"brand"]
[!"office"]
[!"tourism"]
[!"operator"]
// Below is the problem I struggle with
((if: t["building"] && t["building"]~"dormitory|apartments|yes|residential|house");
)->.filtered;
(
.filtered;
>;
);
out body;
The idea is : If the key building existe it should has the value dormitory or apartments or yes or residential or house. If the key doesn't existe we add the node to the result.
If any one can tell me if 1st it's possible, and if possible tell me how to do it / correct my example. thx :)
I tried to find examples in the official doc but not that much result. https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_API_by_Example https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Value_matches_regular_expression_(~,_!~)
Tried some auto correct with AI but not much result too.