Skip to content

Commit

Permalink
ignore postcode areas on reverse
Browse files Browse the repository at this point in the history
Postcode lookups are best done by doing reverse at a higher
level and then extracting the postcode.
  • Loading branch information
lonvia committed Dec 12, 2024
1 parent 0862671 commit d9b4d15
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/nominatim_api/reverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ def _base_query() -> SaSelect:
# 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))\
Expand Down

0 comments on commit d9b4d15

Please sign in to comment.