]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/api/reverse.py
enable API use with psycopg 3
[nominatim.git] / 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)