If i add a clause querying the official_name tag of the city of london:
[out:json][timeout:25];
relation["admin_level"="8"][ ~"^designation.*$"~"_london_borough$"];
relation["official_name" = "City and County of the City of London"];
(._; way(r); node(w););out meta;
Instead of all of the boroughs plus city of london, I get only the city of london.
haven’t been able to find where I went wrong yet. any suggestions or solutions appreciated.
Missing brackets, so only the last line is taken into account, try:
[out:json][timeout:25];
(
relation["admin_level"="8"][ ~"^designation.*$"~"_london_borough$"];
relation["official_name" = "City and County of the City of London"];
);
(._; way(r); node(w););out meta;
As noted union brackets are required.
Also cleaned up regex. (I, personally, prefer to state the search criteria explicitly, if known, as it speeds search up & makes it clear when referring ot it a year later.)
Unsure of your requirements, but most won’t need to have every node listed, so just used out geom;
Plus: used rel & removed unnecessary quote marks.
(
rel[admin_level=8][designation~"outer_london_borough|inner_london_borough"];
rel[official_name="City and County of the City of London"];
);
//(._; way(r); node(w););
out geom;
Thanks, is there an elegant way to remove the handful of nodes that are still included in that query, only including the polygons? I’ve been doing that in post processing so far.
Again, unsure of your requirements as you don’t state them, but recursing down to ways returns just the ways (but no relations data)
(
rel[admin_level=8][designation~"outer_london_borough|inner_london_borough"];
rel[official_name="City and County of the City of London"];
);
way(r);
out geom;