diff options
author | Dave Arter <davea@mysociety.org> | 2015-08-24 11:03:22 +0100 |
---|---|---|
committer | Steven Day <steve@mysociety.org> | 2015-08-25 09:25:45 +0100 |
commit | 079685ece21de56ae61379e66c159d5053516476 (patch) | |
tree | ac44891cc53723fe0de9ba75b036dded3b8255fd | |
parent | 992ee8a08f18459cff7f68ef1f120920777027fb (diff) |
[Bromley] Switch from Bing to OSM geocoder for Bromley
Bing's geocoder is generating increasing numbers of erroneous results,
so let's see how OSM fares instead.
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bromley.pm | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm index fbf831eb6..687843a2a 100644 --- a/perllib/FixMyStreet/Cobrand/Bromley.pm +++ b/perllib/FixMyStreet/Cobrand/Bromley.pm @@ -20,19 +20,7 @@ sub disambiguate_location { my $town = 'Bromley'; - # Helpful regexes that are used often - my $road = 'r(?:oa)?d'; - my $street = 'st(\.|reet)?'; - - # Bing turns High St Bromley into Bromley High St which is in - # Bromley by Bow. - $town .= ', BR1' if $string =~ /^high\s+${street}$/i; - - # Disambiguations required for BR5 - $town .= ', BR5' if $string =~ /^kelsey\s+${road}$/i; - $town = 'BR5 Bromley' if $string =~ /^leith\s+hill$/i; # doesn't like appended BR5 for some reason - - # There has also been a road name change for a section of Ramsden Road + # There has been a road name change for a section of Ramsden Road # (BR5) between Church Hill and Court Road has changed to 'Old Priory # Avenue' - presently entering Old Priory Avenue simply takes the user to # a different Priory Avenue in Petts Wood @@ -41,26 +29,10 @@ sub disambiguate_location { $string = 'Ramsden Road'; $town = ', BR6 0PL'; } - $town .= ', BR5' if $string =~ /^meadway/i; - $town .= ', BR5' if $string =~ /^mill\s+brook\s+${road}$/i; - $town .= ', BR5' if $string =~ /^kent\s+${road}$/i; - $town .= ', BR5' if $string =~ /^the\s+landway$/i; - $town .= ', BR5' if $string =~ /^mountfield\s+way$/i; - $town .= ', BR5 3' if $string =~ /^star\s+lane$/i; - $town .= ', BR5 4AX' if $string =~ /^high\s+${street}?(,)?\s?st\.?\s+mary\s+cray$/i; - - # and BR6 - $town .= ', BR6' if $string =~ /^berrylands/i; - $town .= ', BR6' if $string =~ /^crofton\s+${road}$/i; - $town .= ', BR6' if $string =~ /^crofton\s+lane$/i; # White Horse Hill is on boundary with Greenwich, so need a # specific postcode - $town = 'chislehurst, BR7 6DH' if $string =~ /^white\s+horse/i; - - # Mottingham Lane is 90% inside Bromley, but goes outside too and Bing - # defaults to the top end of it. - $town = 'Mottingham Lane, SE9 4RW' if $string =~ /^mottingham\s+lane/i; + $string = 'BR7 6DH' if $string =~ /^white\s+horse/i; $town = '' if $string =~ /orpington/i; @@ -73,6 +45,10 @@ sub disambiguate_location { }; } +sub get_geocoder { + return 'OSM'; # default of Bing gives poor results, let's try overriding. +} + sub example_places { return ( 'BR1 3UH', 'Glebe Rd, Bromley' ); } |