diff options
author | Dave Arter <davea@mysociety.org> | 2016-06-29 11:07:36 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-07-07 11:28:33 +0100 |
commit | 5b9670512542f54588cc89f2eefc943db26b9ee2 (patch) | |
tree | b929b12826b3a916e68003559a222bd62f4ac53f /perllib/Geo/Coordinates/CH1903.pm | |
parent | 6d3cbb5d58c0297959c541da50faaf39884ffe1c (diff) |
[Zurich] Use new LV95/CH1903+ geocoder and base map tiles
- Use new `getLocation95` method for geocoding addresses
- Replace Coordinates::CH1903 with Coordinates::CH1903Plus
- Refactor Map::Zurich to use WMTSBase instead of duplicating code
- Slightly refactor map templates to make using custom WMTS tiles easier
- Use correct sizes for marker pins on maps
Closes mysociety/FixMyStreet-Commercial#769.
Closes mysociety/FixMyStreet-Commercial#768.
Diffstat (limited to 'perllib/Geo/Coordinates/CH1903.pm')
-rw-r--r-- | perllib/Geo/Coordinates/CH1903.pm | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/perllib/Geo/Coordinates/CH1903.pm b/perllib/Geo/Coordinates/CH1903.pm deleted file mode 100644 index 6611af9f2..000000000 --- a/perllib/Geo/Coordinates/CH1903.pm +++ /dev/null @@ -1,103 +0,0 @@ -# Geo::Coordinates::CH1903 -# Conversion between WGS84 and Swiss CH1903. -# -# Copyright (c) 2012 UK Citizens Online Democracy. This module is free -# software; you can redistribute it and/or modify it under the same terms as -# Perl itself. -# -# WWW: http://www.mysociety.org/ - -package Geo::Coordinates::CH1903; - -$Geo::Coordinates::CH1903::VERSION = '1.00'; - -use strict; - -=head1 NAME - -Geo::Coordinates::CH1903 - -=head1 VERSION - -1.00 - -=head1 SYNOPSIS - - use Geo::Coordinates::CH1903; - - my ($lat, $lon) = ...; - my ($e, $n) = Geo::Coordinates::CH1903::from_latlon($lat, $lon); - my ($lat, $lon) = Geo::Coordinates::CH1903::to_latlon($e, $n); - -=head1 FUNCTIONS - -=over 4 - -=cut - -sub from_latlon($$) { - my ($lat, $lon) = @_; - - $lat *= 3600; - $lon *= 3600; - - my $lat_aux = ($lat - 169028.66) / 10000; - my $lon_aux = ($lon - 26782.5) / 10000; - - my $x = 600072.37 - + (211455.93 * $lon_aux) - - (10938.51 * $lon_aux * $lat_aux) - - (0.36 * $lon_aux * $lat_aux**2) - - (44.54 * $lon_aux**3); - - my $y = 200147.07 - + (308807.95 * $lat_aux) - + (3745.25 * $lon_aux**2) - + (76.63 * $lat_aux**2) - - (194.56 * $lon_aux**2 * $lat_aux) - + (119.79 * $lat_aux**3); - - return ($x, $y); -} - -sub to_latlon($$) { - my ($x, $y) = @_; - - my $x_aux = ($x - 600000) / 1000000; - my $y_aux = ($y - 200000) / 1000000; - - my $lat = 16.9023892 - + (3.238272 * $y_aux) - - (0.270978 * $x_aux**2) - - (0.002528 * $y_aux**2) - - (0.0447 * $x_aux**2 * $y_aux) - - (0.0140 * $y_aux**3); - - my $lon = 2.6779094 - + (4.728982 * $x_aux) - + (0.791484 * $x_aux * $y_aux) - + (0.1306 * $x_aux * $y_aux**2) - - (0.0436 * $x_aux**3); - - $lat = $lat * 100 / 36; - $lon = $lon * 100 / 36; - - return ($lat, $lon); -} - -=head1 AUTHOR AND COPYRIGHT - -Maths courtesy of the Swiss Federal Office of Topography: -http://www.swisstopo.admin.ch/internet/swisstopo/en/home/products/software/products/skripts.html - -Written by Matthew Somerville - -Copyright (c) UK Citizens Online Democracy. - -This module is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. - -=cut - -1; - |