]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge pull request #3609 from lonvia/reverse-ignore-postcode-areas
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 13 Dec 2024 08:00:26 +0000 (09:00 +0100)
committerGitHub <noreply@github.com>
Fri, 13 Dec 2024 08:00:26 +0000 (09:00 +0100)
Ignore postcode areas on reverse

src/nominatim_api/reverse.py

index 8a75c5b94961b5885f0da5391b2f2cbd24fa22cc..c9f11b6326bd3b32e07eb57297eb9bf8fc61cdaa 100644 (file)
@@ -362,6 +362,8 @@ class ReverseGeocoder:
             # later only a minimum of results needs to be checked with ST_Contains.
             inner = sa.select(t, sa.literal(0.0).label('distance'))\
                       .where(t.c.rank_search.between(5, MAX_RANK_PARAM))\
+                      .where(t.c.rank_address != 5)\
+                      .where(t.c.rank_address != 11)\
                       .where(t.c.geometry.intersects(WKT_PARAM))\
                       .where(sa.func.PlacexGeometryReverseLookuppolygon())\
                       .order_by(sa.desc(t.c.rank_search))\