From looking at the code I would say that around is indeed not yet implemented for areas. You might want to raise an issue for this on github. However, you could as well use the corresponding relation and run around on the relation instead:
Try it on overpass turbo In fact, you can skip the area part altogether and start with the relation for a simpler approach:
Try it on overpass turbo BTW: In your overpass api query you seem to check for nodes with "addr:postcode". This doesn't exactly match your question where you wanted to find postal codes within a given radius around a specific postal code. Maybe you want to rephrase your question a bit to clarify what you are looking for. A slightly modified version of the last query will return all relevant relations. In a post-processing step, you'll have to extract the postal code from the relations to get a list of postal codes:
Try it on overpass turbo (you can ignore the warning message when executing the query) answered 15 Aug '14, 06:21 mmd Well I was actually looking for an opportunity to get all postal codes within a specific radius. Let's say, I do have Bonn's postal code and would like to get all postal codes within a radius of 10.000m calculated from Bonn's postal code area (or its center). I'm not very much interested in all border nodes, streets etc, I just would like to get the postal codes within the given radius. Does this clarify my problem? EDIT: I think I'm gettin closer now: rel[boundary=postal_code][postal_code="53111"]->.a;(rel(around.a:10000)[boundary=postal_code][postal_code][postal_code!="53111"][postal_code_level][type="boundary"];);out;
(15 Aug '14, 09:21)
Korbi
1
Ok, I've updated my reply. Note that you'll have to do some kind of post processing on the result to extract a list of postal codes from the list of relations. However, this should be straightforward.
(15 Aug '14, 09:29)
mmd
Thanks for your help, it seems our answers just crossed ;)
(15 Aug '14, 09:38)
Korbi
|
Hello, I have exactly the same need and the query suits me perfectly :
I just want to specify the country of the postal code in my query. Can you help me!
permanent link
This answer is marked "community wiki".
answered 05 Jan '22, 08:16 AYADI |