osm-search / Nominatim

Open Source search based on OpenStreetMap data
https://nominatim.org
GNU General Public License v3.0
3.11k stars 713 forks source link

Reverse: improve handling of unnamed streets on address-level lookup #3412

Open lonvia opened 5 months ago

lonvia commented 5 months ago

When doing reverse lookup on an address level, the algorithm usually looks for the closest housenumbers and streets. If the closest object is a street, it then tries to qualify the address by looking for the closest address the street is a parent of. The reason we do it that way is simple: assume the reverse geo coordinate falls right on a street. if Nominatim just looks for the closest housenumber, it might find an address that belongs to a different street because we happen to be near a street corner and the house gets its address from another nearby street. The result is that Nominatim reports a confusing address. By looking up the street and then going back to the housenumber, the street name reported will always be right.

The algorithm fails when the closest street is an unnamed service road. Nearby housenumbers will get a named street as a parent, not the service road. So going from service road to nearby housenumber will pretty much always fail. In case of an unnamed road, it might be preferable to simply look for addresses in the nearby area.

To be considered: there are countries where streets usually do not get a name. Whatever the algorithm does, it needs to deliver sensible results in that case.

matkoniecz commented 2 months ago

To be considered: there are countries where streets usually do not get a name. Whatever the algorithm does, it needs to deliver sensible results in that case.

(...)

it then tries to qualify the address by looking for the closest address the street is a parent of

what about cases where street is named but has no matching addresses (addresses are present, roads are named but addresses are not using streets as part of their address?)