diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-12-03 10:46:54 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-12-03 10:53:09 +0000 |
commit | 2cf8ba561104a67d5d6e8d2eca0d0a6fe91ccff5 (patch) | |
tree | f845e720323ba7243f1b0e45b35ed2d4756bf035 /perllib/Geo/Coordinates | |
parent | 9479d41f7b004f48f0a73c075ea454c23e7d9036 (diff) |
Simplify projection logic, and use X/Y same way round as everywhere else.
Diffstat (limited to 'perllib/Geo/Coordinates')
-rw-r--r-- | perllib/Geo/Coordinates/CH1903.pm | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/perllib/Geo/Coordinates/CH1903.pm b/perllib/Geo/Coordinates/CH1903.pm index 611126962..612182152 100644 --- a/perllib/Geo/Coordinates/CH1903.pm +++ b/perllib/Geo/Coordinates/CH1903.pm @@ -37,21 +37,11 @@ Geo::Coordinates::CH1903 =cut -sub deg2sec($) { - my $angle = shift; - - my $deg = int($angle); - my $min = int(($angle - $deg) * 60); - my $sec = ((($angle - $deg) * 60) - $min) * 60; - - return $sec + ($min * 60) + ($deg * 3600); -} - sub from_latlon($$) { my ($lat, $lon) = @_; - $lat = deg2sec($lat); - $lon = deg2sec($lon); + $lat *= 3600; + $lon *= 3600; my $lat_aux = ($lat - 169028.66) / 10000; my $lon_aux = ($lon - 26782.5) / 10000; |