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

I want to get all streetnames, the neighborhood (suburb) of that street, zipcode, and all housenumbers of the street with their individual latitude/longitude for the COUNTRY of Germany.

For example, the details from this node: https://www.openstreetmap.org/node/3081665937

I found this: https://help.openstreetmap.org/questions/23488/export-streets-names and https://help.openstreetmap.org/questions/9816/the-best-way-to-extract-street-list

I tried following what's here: https://wiki.openstreetmap.org/wiki/Osmconvert I downloaded osmconvert.exe already.

But the existing answers don't seem to provide a clear cut solution for what I think is a common request. I see other people struggling too, but then they don't post what worked for them if it even did.

I don't want to download per city (takes a lot of work) or use polygons (lot of work and error prone) for a specific area. I just want the above details for street nodes in a specific country.

What would be the command(s) to do this? Also taking into account the --max-refs parameter as this might result in a lot of nodes.

asked 11 May '22, 17:20

ItsPete1987's gravatar image

ItsPete1987
11112
accept rate: 0%


It is a common request but there is not an easy solution.

You can extract all objects - nodes and ways - that have a house number AND a street name AND a city AND a postcode. That is relatively easy. However, your result will not contain all street names, for example here's a street that will be missing (all examples are current as of May 11, 2022):

https://www.openstreetmap.org/way/30761152

because there are no house numbers mapped along that street. You will also be missing this street

https://www.openstreetmap.org/way/632243700

because while there are house numbers, the addresses are mapped without an addr:street or addr:postcode or addr:city tag. For the same reason you will be missing almost all streets in Haßbergen: https://www.openstreetmap.org/#map=16/52.7307/9.2317

And so on. And this is not even starting to discuss the corner case of address interpolation lines.

It is a complicated issue and no one solution exists that solves everything. The cheap and easy approach is to indeed look only for objects with addr:* tags - no polygons required. On the other hand, if you want to capture streets that do not have addresses on them as well, then you will have to choose one of the solutions that looks at highway=* objects too. Since these will never have city or postal code names tagged on them, you will then have to look at city and postal code polygons to determine the matching values.

The most flexible solution is probably importing everything into a PostGIS database with osm2pgsql, and then applying the necessary SQL to get what you want.

permanent link

answered 11 May '22, 18:51

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 11 May '22, 18:53

Your answer
toggle preview

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:

×275
×205
×111
×11

question asked: 11 May '22, 17:20

question was seen: 1,091 times

last updated: 11 May '22, 18:53

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