diff options
author | Matthew Somerville <matthew@fury.ukcod.org.uk> | 2011-02-11 11:14:20 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@fury.ukcod.org.uk> | 2011-02-11 11:14:20 +0000 |
commit | 947f5f9d6c9c74bc5acea7fbc605b653e44f7ce7 (patch) | |
tree | 05f70a75d4f473274e897e8951ff71035c1890fb /perllib/FixMyStreet | |
parent | c8a9805bcb850cab7bf1c1b8c34ef5c4f22e1b73 (diff) |
Helper function for all latlon to OSGB36 calls.
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Alert.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/Geocode.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/Tilma/Original.pm | 5 |
4 files changed, 3 insertions, 10 deletions
diff --git a/perllib/FixMyStreet/Alert.pm b/perllib/FixMyStreet/Alert.pm index 45985502f..cdc070290 100644 --- a/perllib/FixMyStreet/Alert.pm +++ b/perllib/FixMyStreet/Alert.pm @@ -30,7 +30,6 @@ use mySociety::DBHandle qw(dbh); use mySociety::Email; use mySociety::EmailUtil; use mySociety::Gaze; -use mySociety::GeoUtil; use mySociety::Locale; use mySociety::MaPit; use mySociety::Random qw(random_bytes); diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm index 9ab958cd9..14cedbaeb 100644 --- a/perllib/FixMyStreet/Geocode.pm +++ b/perllib/FixMyStreet/Geocode.pm @@ -18,8 +18,8 @@ use URI::Escape; use Cobrand; use Page; +use Utils; use mySociety::Config; -use mySociety::GeoUtil; use mySociety::Locale; use mySociety::MaPit; use mySociety::PostcodeUtil; @@ -63,9 +63,7 @@ sub geocoded_string_coordinates { $longitude = $1; $latitude = $2; try { - my ($easting, $northing) = mySociety::Locale::in_gb_locale { - mySociety::GeoUtil::wgs84_to_national_grid($latitude, $longitude, 'G'); - }; + my ($easting, $northing) = Utils::convert_latlon_to_en( $latitude, $longitude ); } catch Error::Simple with { $error = shift; $error = _('That location does not appear to be in Britain; please try again.') diff --git a/perllib/FixMyStreet/Map.pm b/perllib/FixMyStreet/Map.pm index 0902914dd..a9978103f 100644 --- a/perllib/FixMyStreet/Map.pm +++ b/perllib/FixMyStreet/Map.pm @@ -14,7 +14,6 @@ use Problems; use Cobrand; use mySociety::Config; use mySociety::Gaze; -use mySociety::GeoUtil qw(national_grid_to_wgs84); use mySociety::Locale; use mySociety::Web qw(ent NewURL); use Utils; diff --git a/perllib/FixMyStreet/Map/Tilma/Original.pm b/perllib/FixMyStreet/Map/Tilma/Original.pm index 4dc4a5817..e32d62442 100644 --- a/perllib/FixMyStreet/Map/Tilma/Original.pm +++ b/perllib/FixMyStreet/Map/Tilma/Original.pm @@ -12,16 +12,13 @@ use strict; use LWP::Simple; use Cobrand; -use mySociety::GeoUtil; use mySociety::Locale; use mySociety::Web qw(ent NewURL); use Utils; sub _ll_to_en { my ($lat, $lon) = @_; - return mySociety::Locale::in_gb_locale { - mySociety::GeoUtil::wgs84_to_national_grid( $lat, $lon, 'G' ); - }; + return Utils::convert_latlon_to_en( $lat, $lon ); } sub header_js { |