Skip to content

C# / .NET Functions for converting WGS84 Latitude and Longitude to Swiss Grid (CH1903 / LV09) Easting and Northing mapping coordinates.

Notifications You must be signed in to change notification settings

mikeirvingweb/LatLngToSwissGrid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lat / Lng to Swiss Grid conversion in C#

🇨🇭 C# Functionality for converting Latitude and Longitude (WGS84) values to The Swiss coordinate system (or Swiss grid). *

* also sometimes referred to as CH1903 or LV09.

📱 This C# code has been derived from that used in my Grid Ref CH1903 mobile app.

How to use

⬇️ Download the repository and open the LatLngToSwissGrid.sln file in Visual Studio.

▶️ Then run it.

✏️ Modify Program.cs to set the WGS84 Latitude and Longitude input variables - lat and lng.

Example

Functions.LLtoSwissGrid(46.963112, 7.464872, out swissEasting, out swissNorthing);

would return swissEasting = 601997, swissNorthing = 201337

Files of interest

Whilst the entire repository can be compiled and used as a C# / .NET Console App, these are the main files.

💻 Program.cs - the controller of the console app, showing you how to use the LLtoSwissGrid (double Lat, double Long, out double SwissEasting, out double SwissNorthing) function.

🔢 Functions.cs - the mathematical functions that perform the grid coordinate conversion.

Contributions

🍴 Feel free to Fork / Branch / Modify, raise any Pull Requests for changes.

Also available

Lat / Lng to: Gauss–Krüger.

About

C# / .NET Functions for converting WGS84 Latitude and Longitude to Swiss Grid (CH1903 / LV09) Easting and Northing mapping coordinates.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages