From eb5a7dcdb44f111a5d6f480ef9bb4b796abbc79a Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 10 Feb 2011 20:31:19 +0000 Subject: Put back UK-only code for atomic nature of E/N -> lat/lon conversion, module has other UK-only code in it still and it causes error without. --- perllib/FixMyStreet/Geocode.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'perllib/FixMyStreet/Geocode.pm') diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm index 0379169b8..355cd827f 100644 --- a/perllib/FixMyStreet/Geocode.pm +++ b/perllib/FixMyStreet/Geocode.pm @@ -61,6 +61,13 @@ sub geocoded_string_coordinates { } elsif ( $js =~ /"coordinates" *: *\[ *(.*?), *(.*?),/ ) { $longitude = $1; $latitude = $2; + try { + my ($easting, $northing) = mySociety::GeoUtil::wgs84_to_national_grid($latitude, $longitude, 'G'); + } catch Error::Simple with { + $error = shift; + $error = _('That location does not appear to be in Britain; please try again.') + if $error =~ /out of the area covered/; + } } return ($latitude, $longitude, $error); } -- cgit v1.2.3