Overpass turbo: is_in output

Thanks to @langlaeufer for solving my earlier query.

I now have a list of mosques in Scotland, but not all of them have addresses.

Can Overpass tell me which city each of them is in?

Or better still, can it tell me the nearest postcode centroid?

I’ve found this question on substack, but I don’t understand the answer:

Thank you.

the nearest postcode centroid is not always the right one!
you should better search for the postcode area (polygon)

Did you have in mind using boundary=postal_code directly from OSM data? I don’t think that’s an option for Scotland (or probably most countries outside Central Europe).

Or some other way of getting a polygon?

1 Like

I don’t think they’re actually areas? IIRC they’re basically groups of address that correspond to the smallest unit of route that can be assigned to a postie. I can’t remember where I saw this said though.

Maybe the postcode is a distraction.

I’m looking for any way of approximating the address using Overpass.

Closest street, closest city, enclosing postcode, enclosing admin_level=6 area (useful for other reasons, too), etc.