From 1e2a1d9ce5e81d399cdd4c8dc7f4d9c13f63a27b Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Thu, 30 Mar 2023 09:58:02 +0200 Subject: [PATCH] limit results for country lookup --- nominatim/api/reverse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nominatim/api/reverse.py b/nominatim/api/reverse.py index 1c9cd4c1..42fe8f36 100644 --- a/nominatim/api/reverse.py +++ b/nominatim/api/reverse.py @@ -500,7 +500,8 @@ class ReverseGeocoder: .where(t.c.rank_address == 4)\ .where(t.c.rank_search == 4)\ .where(t.c.linked_place_id == None)\ - .order_by('distance') + .order_by('distance')\ + .limit(1) sql = self._add_geometry_columns(sql, t.c.geometry) -- 2.39.5