aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-10-18 15:45:57 +0100
committerStruan Donald <struan@exo.org.uk>2011-10-18 15:45:57 +0100
commitf524d4cbebeece580fb21a66231f2ae3d164666c (patch)
tree1712443bd16de80cdba0f28fa48a1f83a41040b5
parent41f45b09f1c23e030a286d6f11a7bac3a34d1090 (diff)
append town name to Bing gecode queries if provided to decrease false matches
-rw-r--r--perllib/FixMyStreet/Cobrand/Reading.pm1
-rw-r--r--perllib/FixMyStreet/Geocode/Bing.pm1
2 files changed, 2 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Reading.pm b/perllib/FixMyStreet/Cobrand/Reading.pm
index 6ec0a7958..f4fd0dc7a 100644
--- a/perllib/FixMyStreet/Cobrand/Reading.pm
+++ b/perllib/FixMyStreet/Cobrand/Reading.pm
@@ -64,6 +64,7 @@ sub all_councils_report {
sub disambiguate_location {
return {
+ town => 'Reading',
centre => '51.452983169803964,-0.98382678731985973',
span => '0.0833543573028663,0.124500468843446',
bounds => [ '51.409779668156361,-1.0529948144525243', '51.493134025459227,-0.92849434560907829' ],
diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm
index b804102c9..962f8fe15 100644
--- a/perllib/FixMyStreet/Geocode/Bing.pm
+++ b/perllib/FixMyStreet/Geocode/Bing.pm
@@ -22,6 +22,7 @@ use Digest::MD5 qw(md5_hex);
# may be used to disambiguate the location in cobranded versions of the site.
sub string {
my ( $s, $c, $params ) = @_;
+ $s .= '+' . $params->{town} if $params->{town};
my $url = "http://dev.virtualearth.net/REST/v1/Locations?q=$s&c=en-GB"; # FIXME nb-NO for Norway
$url .= '&mapView=' . $params->{bounds}[0] . ',' . $params->{bounds}[1]
if $params->{bounds};