1

I can make an area in Overpass QL, using name and relation attributes (tags) filter of element, something like this:

area["name:en"="Moscow Oblast"]["boundary"="administrative"]["admin_level"="4"]->.region;
(node(area.region)[place="city"];node(area.region)[place="town"];);
out;

But searching via name is not so stable, and will broke if element name is changed. So much better (for performance too) is to make an area from element id. Here is example of searching relation via it's element id:

rel(51490);
out;

And can't understand, how to pass element type and id to area query? Something like this:

area(rel(51490))->.region;
(node(area.region)[place="city"];node(area.region)[place="town"];);
out;

or other variants like area["id"=51490]->.region; or area["type"="rel"]["rel"=51490])->.region; don't works.

Can anyone give me an example, how to make area from OSM element by it's id?

1 Answer 1

1

Thanks to quick answer of @mmd from Slack, here is working solution:

rel(51490);map_to_area->.region;
node(area.region)[place="city"];
out;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.