diff options
-rwxr-xr-x | bin/populate_bing_cache | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode/Bing.pm | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/bin/populate_bing_cache b/bin/populate_bing_cache index a3bef6759..17c8911d0 100755 --- a/bin/populate_bing_cache +++ b/bin/populate_bing_cache @@ -9,6 +9,8 @@ use Data::Dumper; use FixMyStreet::App; use FixMyStreet::Geocode::Bing; +my $bing_culture = 'en-GB'; + my $reports = FixMyStreet::App->model('DB::Problem')->search( { geocode => undef, @@ -46,7 +48,7 @@ while ( my $report = $reports->next ) { next if $report->geocode; my $j = FixMyStreet::Geocode::Bing::reverse( $report->latitude, - $report->longitude ); + $report->longitude, $bing_culture ); $report->geocode($j); $report->update; diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index a99bec65e..a4b7cecf2 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -459,7 +459,7 @@ sub find_closest { my ( $self, $latitude, $longitude, $problem ) = @_; my $str = ''; - if ( my $j = FixMyStreet::Geocode::Bing::reverse( $latitude, $longitude ) ) { + if ( my $j = FixMyStreet::Geocode::Bing::reverse( $latitude, $longitude, disambiguate_location()->{bing_culture} ) ) { # cache the bing results for use in alerts if ( $problem ) { $problem->geocode( $j ); @@ -506,7 +506,7 @@ sub find_closest_address_for_rss { # if we've not cached it then we don't want to look it up in order to avoid # hammering the bing api # if ( !$j ) { - # $j = FixMyStreet::Geocode::Bing::reverse( $latitude, $longitude, 1 ); + # $j = FixMyStreet::Geocode::Bing::reverse( $latitude, $longitude, disambiguate_location()->{bing_culture}, 1 ); # $problem->geocode( $j ); # $problem->update; diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm index 4045371a5..70275c2c7 100644 --- a/perllib/FixMyStreet/Geocode/Bing.pm +++ b/perllib/FixMyStreet/Geocode/Bing.pm @@ -68,13 +68,13 @@ sub string { } sub reverse { - my ( $latitude, $longitude, $cache ) = @_; + my ( $latitude, $longitude, $bing_culture, $cache ) = @_; # Get nearest road-type thing from Bing my $key = mySociety::Config::get('BING_MAPS_API_KEY', ''); if ($key) { my $url = "http://dev.virtualearth.net/REST/v1/Locations/$latitude,$longitude?key=$key"; - $url .= '&c=' . $params->{bing_culture} if $params->{bing_culture}; + $url .= '&c=' . $bing_culture if $bing_culture; my $j; if ( $cache ) { my $cache_dir = FixMyStreet->config('GEO_CACHE') . 'bing/'; |