- SEE ALSO
- BUGS AND CAVEATS
- SOURCE CODE
- LICENSE AND COPYRIGHT
Geo::Coordinates::Converter::LV03 - Convert Swiss LV03 coordinates to WSG84 and vice versa
use Geo::Coordinates::Converter::LV03; my ($x, $y) = Geo::Coordinates::Converter::LV03::lat_lng_2_y_x($φ, $λ); my ($φ, $λ) = Geo::Coordinates::Converter::LV03::y_x_2_lat_lng($x, $y);
y_x_2_lat_lng are exported:
use Geo::Coordinates::Converter::LV03 qw(lat_lng_2_y_x y_x_2_lat_lng); my ($x, $y) = lat_lng_2_y_x($φ, $λ); my ($φ, $λ) = y_x_2_lat_lng($x, $y);
Convert a latitude/longitude tuple to a Swiss LV03 datum.
Note: the Swiss seem to name the east-west axis by Y and the the north-south axis by X. Hence the strangly order of
x in the sub's name.
Convert a Swiss LV03 datum to a latitude and longitude tuple.
Note: the Swiss seem to name the east-west axis by Y and the the north-south axis by X. Hence, the first argument is named
y, the second
The document from which I derived the formulas (see LINKS) contains this friendly warning; »Diese Formeln haben eine reduzierte Genauigkeit und sind vor allem für Navigationszwecke vorgesehen. Sie dürfen nicht für die amtliche Vermessung oder für geodätische Anwendungen verwendet werden!« (that is: only to be used for navigational purposes, not of exact (or even official) measurements or geodatic applications).
Why was I not using the already existing Geo::Coordinates::Converter?
I tried, but that module's code seemed too hard and esoteric to extend. So I made this module a seperate one.
<rene.nyffenegger at adp-gmbh.ch>
The common order of using lattitude and longitude is first: lattitude, the longitude. lattitude goes in y-direction, longitude in x-direction. So, they're in a different order than the usually known
y. More gravely is the fact, that the
x in "lat_lng_2_y_x" and in "y_x_2_lat_lng" is what usually is the
y, and vice versa. I should and might change that once. Then again, I might not find the time.
Please report any bugs or feature requests to
bug-geo-coordinates-converter-lv03 at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geo-Coordinates-Converter-LV03. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
The source code is in a github repository. Meaningful pull requests are welcome.
Copyright 2017 René Nyffenegger.
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.
If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.
This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.
This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.