NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

So the "ask first, the sign up" did not work for me.

The wiki for boundary:postal_code links to overpass turbo with the following query:

/*
This query looks for nodes, ways and relations 
with the given key/value combination.
Choose your region and hit the Run button above!
*/
[out:json][timeout:25];
// gather results
(
  // query part for: “boundary=postal_code”
  node["boundary"="postal_code"]({{bbox}});
  way["boundary"="postal_code"]({{bbox}});
  relation["boundary"="postal_code"]({{bbox}});
);
// print results
out body;
>;
out skel qt;

It shows all ZIP code boundaries visible on the map How can I filter for one specific code by adding postal_code=12345?

asked 02 Jun '22, 09:36

ohcomeon's gravatar image

ohcomeon
36112
accept rate: 50%


Never mind, I tried the Wizard with "postal_code"=12345 and that generated pretty much the above code except for "postal_code"="12345" instead of "boundary"="postal_code"

permanent link

answered 02 Jun '22, 09:47

ohcomeon's gravatar image

ohcomeon
36112
accept rate: 50%

https://overpass-turbo.eu/s/1iXL

rel[boundary=postal_code][postal_code=04030]({{bbox}});
out body;
>;
out skel qt;

Only relations need to be searched.

permanent link

answered 02 Jun '22, 13:53

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×483
×66
×10
×3

question asked: 02 Jun '22, 09:36

question was seen: 1,393 times

last updated: 02 Jun '22, 13:53

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum