Hello, When performing searches that yield multiple results, I've noticed what looks like an intuitive ordering in the output. For instance, searching London yields the English capital as first result, as opposed to the London county in Ontario, Canada or the city in Arkansas, USA; searching Manhattan gives the New York City municipality as first result, as opposed to the city in Kansas, USA or the locality in Poland; searching Berlin yields the German capital as first result as opposed to any of the (surprisingly numerous) cities named Berlin in the US. I've also noticed that the Geopy Nominatim client, when configured to return exactly one result, seems to always return the first one. Is it true that results are ordered according to certain criteria? In that case, are the criteria documented? It would actually be helpful for me if this was the case, but I'd love to understand if this is a feature provided by design, a best-effort kind of thing that is provided but isn't guaranteed by the API, or mere coincidence. Thanks! asked 13 May, 23:01 Shai |
(Can't seem to add a comment). The default settings are in When you install Nominatim yourself, and added the wikipedia ranking file (described in the install instructions), it will be almost the same as nominatim.openstreetmap.org. There's a difference searching via a browser (e.g. on openstreetmap.org) and via a script (e.g. geopy): a browser will send your preferred language, and the website usually the current viewpoint of the map. That gives additional hints to the ranking. For example if the map is zoomed a London in the United States then London, UK is less relevant. You can set those with the answered 14 May, 17:27 mtmail OK, now having a look at
(14 May, 17:41)
Shai
|
Yes, results are ordered and this is documented in Nominatim's documentation. Of special interest are probably the chapter on Place Ranking and Wikipedia & Wikidata. answered 14 May, 08:08 Jochen Topf Great, thank you Jochen, I totally missed that section. So, Place Ranking section describes how places are ranked using search ranks and address ranks, which it states are assigned to places on import. It then explains how may one go about configuring ranks. However, I haven't configured any ranks when I imported data into my database, and judging by the intuition I explained in the original post, ranks definitely seem to have been assigned automatically. In that case, do we know with what criteria? Also, is it the same as the online Nominatim? Thanks again.
(14 May, 14:29)
Shai
|
Thanks to both, it doesn't seem like I'm able to upvote your answers :( but I appreciate the help.