PHPackages                             antistatique/swisstopo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. antistatique/swisstopo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

antistatique/swisstopo
======================

Convert GPS (WGS84) to Swiss (LV03 and LV95) coordinates (and vice versa)

1.2.0(2mo ago)1481.3k↓51.5%4[1 issues](https://github.com/antistatique/swisstopo/issues)MITPHPPHP &gt;=8.4CI passing

Since Jun 12Pushed 2mo ago7 watchersCompare

[ Source](https://github.com/antistatique/swisstopo)[ Packagist](https://packagist.org/packages/antistatique/swisstopo)[ Docs](https://github.com/antistatique/swisstopo)[ RSS](/packages/antistatique-swisstopo/feed)WikiDiscussions dev Synced 4d ago

READMEChangelog (7)Dependencies (14)Versions (12)Used By (0)

Convert World Coordinates to Swiss Coordinates - and vice versa
===============================================================

[](#convert-world-coordinates-to-swiss-coordinates---and-vice-versa)

[![Coverage Status](https://camo.githubusercontent.com/b3fa14231deca35d2affb5198e2258cf725359cfcacac4308068823add2d1af4/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f616e746973746174697175652f7377697373746f706f2f62616467652e7376673f6272616e63683d646576)](https://coveralls.io/github/antistatique/swisstopo?branch=dev)[![Build](https://github.com/antistatique/swisstopo/actions/workflows/tests.yml/badge.svg)](https://github.com/antistatique/swisstopo/actions/workflows/tests.yml)[![Packagist](https://camo.githubusercontent.com/e029e09282f224b1910f59b5b6586cbca1206bd40e76cb1dcc2a810007beb22f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e746973746174697175652f7377697373746f706f2e7376673f6d61784167653d32353932303030)](https://packagist.org/packages/antistatique/swisstopo)[![License](https://camo.githubusercontent.com/6527d70a516c5ab9c71b26b927a39c22df8f169e275d3d626cfa569254a812a1/68747470733a2f2f706f7365722e707567782e6f72672f616e746973746174697175652f7377697373746f706f2f6c6963656e7365)](https://packagist.org/packages/antistatique/swisstopo)[![PHP Versions Supported](https://camo.githubusercontent.com/db2abc4c99337a799d57b191c749e512b551eaebf6ce7c37e0ea9eac2eb1b9f6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e342d3838393242462e737667)](https://packagist.org/packages/antistatique/swisstopo)

Super-simple PHP library to transpose GPS (WGS84) coordinates to/from the Swiss military and civilian coordinate systems CH1903/LV03 (MN03) or CH1995/LV95 (MN95).

In this library, the approximate formulas have been used for the direct conversion of ellipsoidal WGS84 coordinates to Swiss plane coordinates.

These formulas are primarily for navigation purposes and may not be used for official or geodetic survey applications!

Getting started
---------------

[](#getting-started)

You can install `swisstopo` using Composer:

```
composer require antistatique/swisstopo

```

Usage
-----

[](#usage)

Convert GPS (WGS84) to Swiss (LV03 and LV95) coordinates - and vice versa.

### GPS (WGS84) to CH1903/LV03 (MN03)

[](#gps-wgs84-to-ch1903lv03-mn03)

```
$swiss_converter = new Antistatique\Swisstopo\SwisstopoConverter();
$coordinates = $swiss_converter->fromWGSToMN03(46.462057617639, 6.8486736590762);
// Coordinates -> ['x' => 145807.4339423232, 'y' => 554679.5530031546].
```

### CH1903/LV03 (MN03) to GPS (WGS84)

[](#ch1903lv03-mn03-to-gps-wgs84)

```
$swiss_converter = new Antistatique\Swisstopo\SwisstopoConverter();
$coordinates = $swiss_converter->fromMN03ToWGS(554680, 145807);
// Coordinates -> ['lat' => 46.462057617639346, 'long' => 6.848673659076181].
```

### GPS (WGS84) to CH1995/LV95 (MN95)

[](#gps-wgs84-to-ch1995lv95-mn95)

```
$swiss_converter = new Antistatique\Swisstopo\SwisstopoConverter();
$coordinates = $swiss_converter->fromWGSToMN95(46.46312579498212, 6.8534397262208095);
// Coordinates -> ['east' => 2555046.5560538797, 'north' => 1145923.4267763223].
```

### CH1995/LV95 (MN95) to GPS (WGS84)

[](#ch1995lv95-mn95-to-gps-wgs84)

```
$swiss_converter = new Antistatique\Swisstopo\SwisstopoConverter();
$coordinates = $swiss_converter->fromMN95ToWGS(2555047, 1145923);
// Coordinates -> ['lat' => 46.46312579498212,'long' => 6.8534397262208095]
```

Alternative
-----------

[](#alternative)

### Open Source Repository

[](#open-source-repository)

- [ValentinMinder/Swisstopo-WGS84-LV03](https://github.com/ValentinMinder/Swisstopo-WGS84-LV03) programmatic computer scripts to transpose GPS WGS-84 coordinates to/from the swiss military and civilian coordinate system (LV-03/CH-1903). *Converter scripts in many languages: C, GO, Java, JavaScript, PHP, Python, R, SQL.*
- [idris-maps/swiss-projection](https://github.com/idris-maps/swiss-projection) Typescript library to convert from LV03(EPSG:21781) and LV95(EPSG:2056) to WGS84(EPSG:4326) *Typescript library that supports both LV03 and LV95.*
- [hansroland/swissgeo](https://github.com/hansroland/swissgeo) Haskell library to transpose GPS (WGS84) coordinates to/from the Swiss military and civilian coordinate systems CH1903/LV03 (MN03) or CH1995/LV95 (MN95). *Haskell library that supports both LV03 and LV95.*

### REST Services

[](#rest-services)

- [REST web geoservices (REFRAME Web API)](https://www.swisstopo.admin.ch/en/maps-data-online/calculation-services/m2m.html). swisstopo offers different REST ("REpresentational State Transfer") services which allow you to embed coordinates transformations in your own software products or web services. *REST geoservices for reference frame changes WGS84-LV95-LV03/Bessel-LHN95-LN02*

### Online documentation &amp; Converters

[](#online-documentation--converters)

- [Reference systems](https://www.swisstopo.admin.ch/en/knowledge-facts/surveying-geodesy/reference-systems.html) of surveying geodesy.
- [NAVREF](https://www.swisstopo.admin.ch/en/maps-data-online/calculation-services/navref.html) allows you to transform Swiss projection coordinates into global WGS84 coordinates (GPS) and vice versa. *It supports both LV03 and LV95.*
- [REFRAME](https://www.swisstopo.admin.ch/en/maps-data-online/calculation-services/reframe.html) allows you to perform coordinates transformations in planimetry and/or altimetry. *Supported file formats: text with separator, LTOP, DXF, ESRI Shape, INTERLIS 1, Adalin OneOne, Topobase .K*

### Software &amp; DLL

[](#software--dll)

- [GIS tools and applications (FME)](https://shop.swisstopo.admin.ch/en/products/geo_software/GIS_info). swisstopo has developed transformers for the transition of reference frames in position an /or height with FME software. All files which can be read by the FME software (many GIS, CAD and text formats) can be easily processed with this transformer. The CHENyx06 dataset (LV03-&gt;LV95 ou LV03-&gt;ETRS89) is also available as NTv2 regular grid.
- [Developer resources (DLL / JAR)](https://shop.swisstopo.admin.ch/en/products/geo_software/DLL_info). Swisstopo provides shared libraries (DLL or JAR) for software developers which allows transformation of coordinates and heights.
    These transformations can be easily integrated into existing applications (.NET, C++, Visual Basic, Java), websites (Java, MONO, Silverlight) or macros (e.g. VBA).
- [GeoSuite (REFRAME/TRANSINT)](https://shop.swisstopo.admin.ch/en/products/geo_software/GeoSuite_info) consists in a suite of calculation, file editing and data visualizing tools, grouped in one modern and efficient application. It is also optimized for the latest computers and operating systems.

Resources
---------

[](#resources)

- [Approximate formulas for the transformation between Swiss projection coordinates and-WGS84](https://github.com/antistatique/swisstopo/blob/master/doc/ch1903wgs84_e.pdf) - (PDF, 4 pages, 72 KB, English).
- [Formulas and constants for the calculation of the Swiss conformal cylindrical projection and for the transformation between coordinate systems](https://github.com/antistatique/swisstopo/blob/master/doc/refsys_e.pdf) - (PDF, 20 pages, 428 KB, English) .

###  Health Score

59

—

FairBetter than 98% of packages

Maintenance86

Actively maintained with recent releases

Popularity39

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~358 days

Recently: every ~171 days

Total

7

Last Release

66d ago

Major Versions

0.0.1 → 1.0.02024-06-14

PHP version history (4 changes)0.0.1-alphaPHP &gt;=7.0

0.0.1PHP &gt;=8.0

1.1.0PHP &gt;=8.3

1.2.0PHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1841592?v=4)[Kevin Wenger](/maintainers/WengerK)[@WengerK](https://github.com/WengerK)

---

Top Contributors

[![WengerK](https://avatars.githubusercontent.com/u/1841592?v=4)](https://github.com/WengerK "WengerK (101 commits)")

---

Tags

php-libraryswissswisstopo

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/antistatique-swisstopo/health.svg)

```
[![Health](https://phpackages.com/badges/antistatique-swisstopo/health.svg)](https://phpackages.com/packages/antistatique-swisstopo)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
