Skip to content

Commit

Permalink
reduce search area for secondary adresses when areas are involved
Browse files Browse the repository at this point in the history
  • Loading branch information
lonvia committed Feb 9, 2015
1 parent 0de6f37 commit 5d87136
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion sql/functions.sql
Expand Up @@ -1794,7 +1794,20 @@ BEGIN

IF location.rank_address != location_rank_search THEN
location_rank_search := location.rank_address;
location_distance := location.distance * 1.5;
IF location.isguess THEN
location_distance := location.distance * 1.5;
ELSE
IF location.rank_address <= 12 THEN
-- for county and above, if we have an area consider that exact
-- (It would be nice to relax the constraint for places close to
-- the boundary but we'd need the exact geometry for that. Too
-- expensive.)
location_distance = 0;
ELSE
-- Below county level remain slightly fuzzy.
location_distance := location.distance * 0.5;
END IF;
END IF;
ELSE
CONTINUE WHEN location.keywords <@ location_keywords;
END IF;
Expand Down

0 comments on commit 5d87136

Please sign in to comment.