mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-11-25 19:35:02 +03:00
use bbox size for secondary order of results
Helps to return the largest object when deduplicating results.
This commit is contained in:
parent
c172ca8c6c
commit
0770eaa5d0
@ -116,7 +116,7 @@ class ForwardGeocoder:
|
|||||||
limit to the configured number of results.
|
limit to the configured number of results.
|
||||||
"""
|
"""
|
||||||
if results:
|
if results:
|
||||||
results.sort(key=lambda r: r.ranking)
|
results.sort(key=lambda r: (r.ranking, 0 if r.bbox is None else -r.bbox.area))
|
||||||
min_rank = results[0].rank_search
|
min_rank = results[0].rank_search
|
||||||
min_ranking = results[0].ranking
|
min_ranking = results[0].ranking
|
||||||
results = SearchResults(r for r in results
|
results = SearchResults(r for r in results
|
||||||
|
Loading…
Reference in New Issue
Block a user