3

I'm a very beginner with overpass. I need to get all possible house numbers in area with given zip and a part of street.

For example. All houses for: 10178 alex

The result should be or similar to:

Alex-Wedding-Straße, 10178 Berlin
Tunnel Alexanderplatz, 10178 Berlin
Alexanderplatz, 10178 Berlin
Alexanderplatz 1, 10178 Berlin
Kleine Alexanderstraße 1, 10178 Berlin
Alexanderstraße 1, 10178 Berlin
Alexanderplatz 2, 10178 Berlin

I tried the next query, but it returned no results.

area[postal_code=10178][boundary=postal_code]->.a;
way(area.a)["highway"~"^(primary|secondary|tertiary|residential|living_street)$"]["name"~"^alex.*"]->.street;
(
  node["addr:housenumber"](area.street);
  way["addr:housenumber"](area.street);
  relation["addr:housenumber"](area.street);
);
(._;>;);out;

What am I doing wrong?

  • Just a guess: Overpass might not consider a street/way a valid area to search in, or at least not big enough (just a very thin line?). You could probably filter by housenumber and streetname node["addr:housenumber"]["addr.street"~~"^alex.*"], depending on the OSM data that's available – chrki Sep 8 '17 at 3:47
  • "with given zip and a part of street" - so you want all addresses that match both your zip code and the street name? – Mateusz Konieczny Jan 10 '18 at 15:47
  • @Mateusz Konieczny exactly! – retgoat Jan 11 '18 at 2:54
  • "way(area.a)["highway"" was not working as expected as streets have no area. There is "around" but that would also fail as it would catch addresses of nearby streets or not catch some addresses far away. – Mateusz Konieczny Jan 11 '18 at 3:56
2

This query assumes that

  • you want all addresses that match both your zip code and specified part of the street name
  • case insensitivity is preferred (alex filter should match also Alex, AleX etc)
  • postal_code tag is tagged on area with boundary=postal_code (AFAIK not true everywhere)
  • address is using addr:street and addr:housenumber tags
    area[postal_code=10178][boundary=postal_code]->.code;
    (
      node["addr:housenumber"]["addr:street"~"alex",i](area.code);
      way["addr:housenumber"]["addr:street"~"alex",i](area.code);
      relation["addr:housenumber"]["addr:street"~"alex",i](area.code);
    );
    (._;>;);out;
  • Im trying to get something similar to this to work on american streets but it doesn't seem to, do you have an example? – Michael L Watson May 17 at 15:09
  • @MichaelLWatson Please link to a new question that demonstrates what is not working and what you tried. – Mateusz Konieczny May 17 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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