]> git.openstreetmap.org Git - nominatim.git/commitdiff
increase search area when filtering by postcode
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 2 Apr 2024 16:07:23 +0000 (18:07 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 2 Apr 2024 17:36:16 +0000 (19:36 +0200)
nominatim/api/search/db_searches.py
test/python/api/search/test_search_places.py

index c2ac4e161fab05872245e56d0b7840a2b95fa8fa..d74812e682a3453a55ea209c83ebf22a61e75a31 100644 (file)
@@ -678,7 +678,7 @@ class PlaceSearch(AbstractSearch):
                 tpc = conn.t.postcode
                 sql = sql.where(sa.select(tpc.c.postcode)
                                   .where(tpc.c.postcode.in_(self.postcodes.values))
-                                  .where(t.c.centroid.within_distance(tpc.c.geometry, 0.12))
+                                  .where(t.c.centroid.within_distance(tpc.c.geometry, 0.4))
                                   .exists())
 
         if details.viewbox is not None:
index 683f78166c5c47194eca459b518a38dab1a62034..5e06776d23287bd89ba87b3076b4b16685de28e5 100644 (file)
@@ -368,9 +368,9 @@ def test_name_and_postcode(apiobj, frontend, wcount, rids):
     apiobj.add_placex(place_id=991, class_='highway', type='service',
                       rank_search=27, rank_address=27,
                       postcode='11221',
-                      centroid=(10.1, 10.1),
-                      geometry='LINESTRING(9.995 10.1, 10.005 10.1)')
-    apiobj.add_search_name(991, names=[111], centroid=(10.1, 10.1),
+                      centroid=(10.3, 10.3),
+                      geometry='LINESTRING(9.995 10.3, 10.005 10.3)')
+    apiobj.add_search_name(991, names=[111], centroid=(10.3, 10.3),
                            search_rank=27, address_rank=27)
     apiobj.add_postcode(place_id=100, country_code='ch', postcode='11225',
                         geometry='POINT(10 10)')