This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

How to fetch house details with a common regex addr:street value

0

I'm trying to fetch house locations from streets that match a query search:

{{value="Sancti"}}
<osm-script output="json">
  <query type="relation">
    <around lat="40.96515" lon="-5.664" radius="1000"/>
    <has-kv k="addr:street" regv={{value}}/>
  </query>
  <union>
    <item/>
    <recurse type="down"/>
  </union>
  <print/>
</osm-script>

At this point, I would love to be able to get the same amount of information that can be retrived by nominatim when query for a 'ways' that match addr:street 'relation' value like this

So, question is, How can I extend query to retrieve info about buildings on the same street ?

Thanks

asked 02 Jun '13, 17:30

inean's gravatar image

inean
1112
accept rate: 0%

edited 02 Jun '13, 23:01

1

Please explain what you mean by "fetch relations of which matched ways are parent of". I suspect that you may have a misconception here about how buildings are mapped; they do not usually have a direct relationship to a nearby street, but instead they just carry the street name in their addr:street tag. There is an "associatedStreet" relation but it is not widely used.

(02 Jun '13, 18:59) Frederik Ramm ♦

Ok, I've rewritten question a bit, hope this helps. Said that, Nominatim says that there's some kind of parent-child relation between 'relations' with 'tags' 'type' = 'place:house' and 'ways'. What I want is to get that info with overpass.

I'm trying to implement some kind of adapatative search with overpass to retrieve streets that matchs an user query. At some point, it would be interesting that, with house number info, get coordinates of that building. The main reason to not use Nominating is that I need all available candidates around user coordinates and within a radius.

(02 Jun '13, 19:56) inean
1

Nominatim does the "parent-child relation" via the name of the street, it's a simple overpass query you almost did already.

And getting a coordinate for a building is getting the geometry and calculation some middle point.

I agree with Frederik, I can't guess what you really want to do.

(04 Jun '13, 13:55) _al

Source code available on GitHub .