lv95-converter
is a command line tool used to convert Swiss LV95 coordinates to WGS84 and vice-versa. The formulas used are the ones provided by Swisstopo as described in their document Formulas and constants for the calculation of the Swiss conformal cylindrical projection and for the transformation between coordinate systems. To parse the command-line arguments CLI11 by CLIUtils was used.
To install lv95-converter
you can either build it from source or download a package from the latest release.
Install dependency:
- Download the latest tarball and extract it.
- Execute
meson setup build
from inside the source directory to setup the project. - Execute
meson compile -C build
from inside the source directory to build the executable. - Execute
meson install -C build
from inside the source directory to install the executable and the manpage.
To convert LV95 to WGS84 pass the lv95
subcommand to the program and use the -e
and the -n
flag respectively to input LV95 coordinates.
To convert WGS84 to LV95 pass the wgs84
subcommand to the program and use the -n
and the -e
flag respectively to input WGS84 coordinates.
$ lv95-converter --help
Convert LV95 coordinates to WGS84 and vice-versa
Usage: lv95-converter [OPTIONS] SUBCOMMAND
Options:
-h,--help Print this help message and exit
Subcommands:
lv95 convert LV95 to WGS84
wgs84 convert WGS84 to LV95
$ lv95-converter lv95 --help
convert LV95 to WGS84
Usage: lv95-converter lv95 [OPTIONS]
Options:
-h,--help Print this help message and exit
-e,--east FLOAT REQUIRED Easting coordinate (LV95)
-n,--north FLOAT REQUIRED Northing coordinate (LV95)
$ lv95-converter wgs84 --help
convert WGS84 to LV95
Usage: lv95-converter wgs84 [OPTIONS]
Options:
-h,--help Print this help message and exit
-e,--east FLOAT REQUIRED Easting coordinate in WGS84
-n,--north FLOAT REQUIRED Northing coordinate in WGS84