komoot / photon

an open source geocoder for openstreetmap data
Apache License 2.0
1.92k stars 282 forks source link

Results for streets are not ordered by importance of city they are in #277

Open eyalroz opened 6 years ago

eyalroz commented 6 years ago

I'm looking for a street named "Haim Hazaz" (or in Hebrew "חיים הזז"), in the city of Haifa.

If I type "Haim Hazaz" on OSM.org, I get that street as the first option. But if I type it at https://photon.komoot.de/ - I only get some Haim Hazaz's from elsewhere Actually I get it three times from a town called Orr Akiva, which is a bit weird.

Not sure whether I'm doing something wrong, or whether it's a bug, or whether there's some difference in the available GIS data.

hbruch commented 6 years ago

Is result number 13 of this request Haim Hazaz the one you are looking for?

For this specific query, as the Or Akiva results have less additional address information (e.g. no postcode), I suppose elasticsearch's field-length norm to cause these matches to be scored higher.

Concerning the multiple occurences of Or Akiva matches: usually photon deduplicates multiple street matches so that not every single OSM way ist returned. However, the StreetDupesRemover removes duplicates only, if the streetname+postalcode are identical. And as Or Akiva ways don't have an associated postalcode, they are not removed.

I suppose you expect streets with identical names to be sorted according to the importance of their place? I'm not sure how nominatim ranks these matches, but possibly it takes this importance into account so that your expectations are met better.

lonvia commented 6 years ago

Nominatim does compute a secondary importance based on the address. It is the complicated and completely unscientific formula here.

Photon could try something similar: take the importance of the city part of the address, multiply it with a very small factor and add it to the importance of the object. The idea behind this is that it has really only an influence when results are otherwise equal, notably when searching for a street name without stating the city it is in.

eyalroz commented 6 years ago

@hbruch : No, it isn't. I was talking about a small residential street in Haifa, not a highway in Herzliya. So your last paragraph is not relevant in this case...

As for the dupe removal - I guess that's another issue. But I will say that usually, a single town doesn't have multiple streets with the exact same name.

hbruch commented 6 years ago

@hbruch : No, it isn't. I was talking about a small residential street in Haifa, not a highway in Herzliya.

@eyalroz then the street you are looking for this one (way-ID 39177827)? It is currently listed as 10th result.

If this is not the one you are looking for, could you please provide OSM-ID or a specific link? Otherwise I think @lonvia's suggestion should become a proper issue and this one may be closed.

As for the dupe removal - I guess that's another issue. But I will say that usually, a single town doesn't have multiple streets with the exact same name.

Perhaps not multiple streets with same name, but perhaps multiple osm ways referring different segments of the same route. And perhaps different segments (or sides) of the route have different postal codes.

lonvia commented 6 years ago

@hbruch I gave it some more thought and I think this really should be fixed in Nominatim. It should adapt the importance instead of just using the address importance for reordering results.

eyalroz commented 6 years ago

@hbruch : Yes, that's the one. Now, it might be the 10th result by your link, but searching using the website link I gave doesn't give me 10 results, just 5. So it's essentially below the UI's cutoff point :-(

About the multiple "OSM ways" - aren't those indicated as segments of the same larger entity?

kurko commented 6 years ago

@eyalroz afaik https://photon.komoot.de/ is usually outdated. I was having issues as well that were fixed in the latest version, so I had to install it locally.