Example Code

Conversion of geographical coordinates

Code and Documents

Attachment

Introduction

This set of VI's can be used to convert geographical polar coordinates into cartesian coordinates and vice versa.

Earth models like WGS84, Hayford and Bessel1841 are offered.

The algorithm of J. Klotz, published in

"Eine analytische Lösung der Gauss-Krüger-Abbildung",

Zeitschrift für Vermessungswesen 118 (1993) 3, pages 106...116

is used

This method also delivers near by poles of earth quite precise results !

geo2gkk     Convert polar coordinates into cartesian coordinates

gkk2geo     Convert cartesian coordinates into polar coordinates (reverse operation to geo2kk)

geo2gkn     Convert polar coordinates in meridional stripe based cartesian coordinates (stripe nuber is returned as output)

gkn2geo     Convert meridional stripe based cartesian coordinates into polar coordinates

gkn2gkn     Convert meridional stripe based cartesian into cartesian coordinates related to another target merid. stripe

Steps to Complete

Copy all the VI's into a user.lib-subdirectory. That's it.

Additional Notes

The coordinates are specified as complex values.

For polar coordinates: Real part represents longitude [°], imaginary part latitude [°].

Cartesian Coordinates: Real part represents Right value , imaginary part the Height value (has nothing to do with height over ground !)

All VI's should run in base versions. No Mathscript nodes have been used !

VI's are programmed in state diagram manner.

Used Labview-Version: 8.6.1

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors