diff options
author | Matthew Somerville <matthew@fury.ukcod.org.uk> | 2011-02-10 20:31:19 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@fury.ukcod.org.uk> | 2011-02-10 20:31:19 +0000 |
commit | eb5a7dcdb44f111a5d6f480ef9bb4b796abbc79a (patch) | |
tree | 5b838736cfea82ab9c78eb83ad328287114eac00 | |
parent | 6c4f7f1bb64eae40de187c78690426bbd4541515 (diff) |
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.
-rw-r--r-- | perllib/FixMyStreet/Geocode.pm | 7 |
1 files changed, 7 insertions, 0 deletions
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); } |