aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Page.pm
diff options
context:
space:
mode:
authormatthew <matthew>2007-09-03 20:56:30 +0000
committermatthew <matthew>2007-09-03 20:56:30 +0000
commit07d321ca2b1656c65ebe8829a743ee0e22befeae (patch)
treefda179c5e972a8e1d1e044eb0f0a1297202a8985 /perllib/Page.pm
parent6ba0b6a93327abce2cb9c80454e568a8052b4e16 (diff)
Explicitly state UK.
Diffstat (limited to 'perllib/Page.pm')
-rw-r--r--perllib/Page.pm20
1 files changed, 12 insertions, 8 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm
index ad6e25cb9..04c91dc8d 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Page.pm,v 1.63 2007-08-29 23:03:16 matthew Exp $
+# $Id: Page.pm,v 1.64 2007-09-03 20:56:30 matthew Exp $
#
package Page;
@@ -529,13 +529,17 @@ sub geocode_string {
} else {
$js =~ /"coordinates":\[(.*?),(.*?),/;
my $lon = $1; my $lat = $2;
- ($easting, $northing) = mySociety::GeoUtil::wgs84_to_national_grid($lat, $lon, 'G');
- my $xx = Page::os_to_tile($easting);
- my $yy = Page::os_to_tile($northing);
- $x = int($xx);
- $y = int($yy);
- $x -= 1 if ($xx - $x < 0.5);
- $y -= 1 if ($yy - $y < 0.5);
+ try {
+ ($easting, $northing) = mySociety::GeoUtil::wgs84_to_national_grid($lat, $lon, 'G');
+ my $xx = Page::os_to_tile($easting);
+ my $yy = Page::os_to_tile($northing);
+ $x = int($xx);
+ $y = int($yy);
+ $x -= 1 if ($xx - $x < 0.5);
+ $y -= 1 if ($yy - $y < 0.5);
+ } catch {
+ $error = shift;
+ }
}
}
return ($x, $y, $easting, $northing, $error);