]> git.openstreetmap.org Git - nominatim.git/commitdiff
limit results for country lookup
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 30 Mar 2023 07:58:02 +0000 (09:58 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 30 Mar 2023 08:00:19 +0000 (10:00 +0200)
nominatim/api/reverse.py

index 1c9cd4c1708bf435c2dbd5348fb9ddba1f87204e..42fe8f36af7deb613d3db15d3d850e05048e1a75 100644 (file)
@@ -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)