Skip to content

Commit

Permalink
Merge commit '8bc9ec02913a4f3b770f76a05b0b179e951db03c'
Browse files Browse the repository at this point in the history
  • Loading branch information
Simple Geebus committed Jun 21, 2011
2 parents a030d17 + 8bc9ec0 commit 966cd4b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/geocoder/us/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,16 @@ def places_by_city (city, tokens, state)
args = [city] + tokens.clone + [state]
end
metaphones = metaphone_placeholders_for tokens
# Addendum: Don't include unique or business ZIP codes when searching for
# addresses by place name, because weird things happen, like the point winding
# up out in the Pacific Ocean (thanks to the Farallons). Unlike unique ZIP codes,
# general ZIP codes have all been checked to ensure that they're actually within
# their ZCTA.
#
execute("SELECT *, levenshtein(?, city) AS city_score
FROM place WHERE city_phone IN (#{metaphones}) #{and_state} order by priority desc;", *args)
FROM place WHERE city_phone IN (#{metaphones}) #{and_state}
AND status NOT IN ('U','B')
ORDER BY PRIORITY DESC;", *args)
end

# Generate an SQL query and set of parameters against the feature and range
Expand Down

0 comments on commit 966cd4b

Please sign in to comment.