Why not ask your question on the new OpenStreetMap Community Forum?

Hi, A big City can have more than one postal code. Which query can I use to get all postcodes of a given City back? Thanks!


As an example , I live in Stuttgart/Germany which has dozens of postal codes:

data from Germany Post Office webpage:

Stuttgart (PLZ: 70173)

Name: Stuttgart
Postleitzahl: 70173
Bundesland: Baden-Württemberg
Typ: Stadt / Gemeinde
Geografische Position: 48.7666700 / 9.1833300
Regierungsbezirk: Stuttgart
Landkreis: Stadtkreis
Autokennzeichen: S
weitere Postleitzahlen: 70173, 70174, 70176, 70178, 70180, 70182, 70184, 70186, 70188, 70190, 70191, 70192, 70193, 70195, 70197, 70199, 70327, 70329, 70372, 70374, 70378, 70435, 70437, 70439, 70469, 70476, 70499, 70563, 70565, 70567, 70569, 70597, 70599, 70619, 70629

But for this query (below) , I receive only postcodes for only 8 suburbs of Stuttgart in XML: http://nominatim.openstreetmap.org/search/germany/stuttgart?format=xml&polygon=0&addressdetails=1

It would also be helpful, if I could get a list of streets, cause with a combination of City/street, I kann get the postcode. Thanks

Adiition: I want a query with "NOMINATIM" online Format which gives me back data over XML. "SQL"- queries are irrelevant for me.

asked 29 Oct '14, 09:23

Ali%20Sabahi's gravatar image

Ali Sabahi
accept rate: 0%

edited 31 Oct '14, 14:54

aseerel4c26's gravatar image

aseerel4c26 ♦

User wambacher maintains a website , where you can download all postcode areas in Germany in a variety of formats.

Also look at this tread on the German forum

permanent link

answered 30 Oct '14, 16:47

escada's gravatar image

accept rate: 21%

First you need to realize that there is no gurantee that the postcodes are in OSM in the first place, this really depends on where you want to have the data for.

Further the information may be prsent in many different ways, non-exhaustive list:

  • on objects with a place tag
  • on boundary polygons (dedicated and others)
  • in addresses (Karlsruher Schema)

As you can see it really depends on what data is in use and available for the area in question. If you can give us an indication which city you are looking at, we can likely provide a more specific answer.

For your example of Stuttgart (Germany) and Nominatim:

Germany has complete data for postcode areas, see this forum thread for details: http://forum.openstreetmap.org/viewtopic.php?id=23238

AFAIK there are various issues with using postcodes with nominatim, if you want to do queries based on the postcode areas I would suggest using the overpass api / overpass-turbo UI.

permanent link

answered 30 Oct '14, 08:03

SimonPoole's gravatar image

SimonPoole ♦
accept rate: 18%

edited 30 Oct '14, 11:04

aseerel4c26's gravatar image

aseerel4c26 ♦


OP cross-posted the same question in the German forum. See this link for some examples for an overpass api query:


(30 Oct '14, 21:04) mmd

Nominatim only gives back one answer as far as I know. Given any place in a city, there is only 1 valid postal code. That is what Nominatim does. The postal code you see is probably the one where the admin_center node of Stuttgart is located. You will need to query for multiple points (one in each postal code area) or use a different tool. You could retrieve this data via the Overpass API (sorry but no time right now to write detail about that)

(31 Oct '14, 08:43) escada

@Ali Sabahi If you'd like your questions to be answered, it's best not to add them as "new answers" to an original question. Edit the original question or add comments to it - that way all parts of your question are visible in one place.

(31 Oct '14, 09:03) SomeoneElse ♦

(added to the question above)

permanent link

answered 30 Oct '14, 08:34

Ali%20Sabahi's gravatar image

Ali Sabahi
accept rate: 0%

edited 30 Oct '14, 11:02

aseerel4c26's gravatar image

aseerel4c26 ♦


Thanks, but I did not find there the answer I need. I want a query with "NOMINATIM" online Format which gives me back data over XML. In the mentioned thread, the "SQL"- queries were discussed, which are irrelevant for me.

permanent link

answered 31 Oct '14, 08:30

Ali%20Sabahi's gravatar image

Ali Sabahi
accept rate: 0%

edited 31 Oct '14, 08:32

Your answer
toggle preview

Follow this question

By Email:

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



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:


question asked: 29 Oct '14, 09:23

question was seen: 12,559 times

last updated: 31 Oct '14, 14:55

powered by OSQA