redlink-gmbh / redlink-geocoding

Redlink Geocoding Library
Apache License 2.0
3 stars 0 forks source link

Addr:place with openstreetmap #257

Open morrowyn opened 2 months ago

morrowyn commented 2 months ago

Hi,

I noticed the following. I used the following german address:
Place: Bernheck Housenumber: 19a Postacl Code: 91287 City: Plech Country: DE

Expectation is: City: Plech not Bernheck

Desired expectation: Street: Bernheck instead of not having a street type in the returned Place object.

https://www.openstreetmap.org/way/416917744#map=17/49.667121/11.487730

The geocoder returns a Place which uses the addr:place, i.e. Bernheck, as the city. I think this should be Plech. And the place needs to be skipped somehow. However doing a search using 19a 91287 Plech yields nothing, Bernheck 19a 91287 Plech yields a Place .

OpenStreetMap for this address: https://www.openstreetmap.org/way/416917744#map=17/49.667121/11.487730 Google Maps does the following for this address: https://www.google.com/maps/place/Bernheck+19,+91287+Plech,+Germany/ and uses the addr:place as the street.

OSM documentation suggests that the addr:place should not be used as street, however you still need to add Bernheck on the search query in order to get a valid Place. Documentation: https://wiki.openstreetmap.org/wiki/Key:addr:place?uselang=en

What are your thoughts on this by normalizing the addr:place onto the street type for the library. Regards,

ja-fra commented 2 months ago

Hi @morrowyn

thanks for reaching out! I understand your expectation about the correct address in your example, however I'm not sure how to approach this.

The data we get from the OSM-API (Nominatim) for your example does not contain any hint for Plech: https://nominatim.openstreetmap.org/lookup?format=xml&accept-language=en&addressdetails=1&osm_ids=W416917744

<searchresults timestamp="Fri, 13 Sep 2024 06:11:43 +00:00" attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright" querystring="">
  <place place_id="109795885" osm_type="way" osm_id="416917744" ref="Gasthof Seitz" lat="49.6671587" lon="11.4868213" boundingbox="49.6670776,49.6672511,11.4866198,11.4870228" place_rank="30" address_rank="30" display_name="Gasthof Seitz, 17, Bernheck, Plech, Betzenstein (VGem), Landkreis Bayreuth, Bavaria, 91287, Germany" class="amenity" type="restaurant" importance="9.99999999995449e-06">
    <amenity>Gasthof Seitz</amenity>
    <house_number>17</house_number>
    <village>Bernheck</village>
    <municipality>Betzenstein (VGem)</municipality>
    <county>Landkreis Bayreuth</county>
    <state>Bavaria</state>
    <ISO3166-2-lvl4>DE-BY</ISO3166-2-lvl4>
    <postcode>91287</postcode>
    <country>Germany</country>
    <country_code>de</country_code>
  </place>
</searchresults>

So if you have any idea how we could improve the implementation I'll be happy for suggestions!