0

I'd like to list of valid addresses for each street name. Entering the street name and city would return a list of valid addresses. (abandoned/unused building are still valid and returned in the list).

As an alternative option I'd like to enter street name,addresse and city and return true/false if the addresse if valid/invalid

Thx :)

asked 16 Sep '13, 16:28

Marc0's gravatar image

Marc0
0555
accept rate: 0%


2 Answers:
1

If you have a local copy of the OSM database, you can list all addresses by street name (and limited by a bounding box) using some quite simple queries, directly on the database. You can create your own local copy of the database using data from a country extract, or even the whole planet data.

I don't think there is any kind of support for this type of search in the standard API, and I believe there won't be any time soon.

However, even if you had the whole database loaded, most places do not have any street numbering information, and the places that have, only have the starting and ending street numbers for a street or street segment. That said, I believe OSM isn't suitable for this kind of search yet.

permanent link

answered 16 Sep '13, 18:40

MCPicoli's gravatar image

MCPicoli
2.1k123046
accept rate: 24%

1

Also, there is absolutely no guarantee that the addresses are really valid, since anyone can upload incorrect/incomplete/outdated information or make mistakes (minor and catastrophic as well).

(16 Sep '13, 18:43) MCPicoli
1

You could use the Overpass API to query for all addresses of a given street an a given city. See this example query for all addresses in the street Wartburgstraße and city Dresden:

<osm-script output="json">
  <union>
    <query type="node">
      <has-kv k="addr:city" v="Dresden"/>
      <has-kv k="addr:street" v="Wartburgstraße"/>
    </query>
    <query type="way">
      <has-kv k="addr:city" v="Dresden"/>
      <has-kv k="addr:street" v="Wartburgstraße"/>
    </query>
    <query type="relation">
      <has-kv k="addr:city" v="Dresden"/>
      <has-kv k="addr:street" v="Wartburgstraße"/>
    </query>
  </union>
  <print mode="body"/>
  <recurse type="down"/>
  <print mode="skeleton"/>
</osm-script>

You can view a visualized result using overpass turbo.

The Overpass API supports both JSON and XML as output formats. See the Overpass API language guide for more information.

As already mentioned by MCPicoli: This result reflects only the addresses contained in OSM's database and doesn't have to be complete.

permanent link

answered 16 Sep '13, 18:55

scai's gravatar image

scai ♦
31.9k20291442
accept rate: 23%

edited 16 Sep '13, 18:56

1

It would be great if São Paulo, Brazil had 10% of the data that Berlin has. Thanks for the tip on the Overpass API. I will try to install it on my local server and do some experimentation...

(16 Sep '13, 19:12) MCPicoli

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:

×27

question asked: 16 Sep '13, 16:28

question was seen: 14,204 times

last updated: 16 Sep '13, 19:12

powered by OSQA