Search notes:

Perl module Geo::Coordinates::Converter::LV03

My first Perl module! It converts Swiss LV03 coordinates to WSG84 and vice versa.
#!/usr/bin/perl
use warnings;
use strict;

use Geo::Coordinates::Converter::LV03;

# Alte Sternwarte Bern
# https://tools.wmflabs.org/geohack/geohack.php?pagename=Sternwarten_Bern&language=de&params=46.951081_N_7.438637_E_dim:500_region:CH-BE_type:landmark&title=alte+Sternwarte+Bern
my ($lat, $lng) = Geo::Coordinates::Converter::LV03::y_x_2_lat_lng(600_000, 200_000);

printf "  %9.7f°  %9.7f°\n", $lat, $lng;
#
#  46.9510811°  7.4386372°

my ($y, $x) = Geo::Coordinates::Converter::LV03::lat_lng_2_y_x($lat, $lng);

printf "  %9.3f   %9.3f\n", $y, $x;
#
#  600000.346   199999.831
Github repository PerlModules, path: /Geo/Coordinates/Converter/LV03/script.pl

See also

Perl modules

Links

Source code on GitHub.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758207708, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Perl/modules/Geo/Coordinates/Converter/LV03/index(64): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78