2

I'm trying to download some buildings from Overpass Turbo. Most of the buildings have a unique address which is tagged on the way of the building, but few of them have multiple addresses as a node (either randomly inside the building or as entrances). e.g. https://www.openstreetmap.org/way/45772548

How can I retrieve all the addresses associated with them? I've read that I should do reverse geocoding with Nominatim, but I can only retrieve one address for a given coordinate.

2
  • Can you give an example? Commented Mar 23 at 10:49
  • @Babel using the link I provided in the description with overpass turbo: osm.li/Lab If you look at the raw data, not addresses are associated with this building as they are mapped as separate node. Commented Mar 27 at 19:20

1 Answer 1

1

After digging multiple hours into the docs, I've found a way:

[out:json][timeout:25000]; ( way(45772548) -> .building; foreach .building { map_to_area -> .building_area; // Filter addresses node by excluding node with name (so amenity, tourism, leisure, etc.) node(area.building_area)["addr:housenumber"][!"name"] ->.addresses; foreach .addresses { convert associated_addresses "__associated_id"=building_area.u(id()), ::=::; out geom; } } ); .building out geom; 

Live: https://osm.li/Hgb

It can probably be optimized, but I'm not experienced enough.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.