Converting between Maidenhead locator (used in amateur radio) and latitude/longitude, and calculating of distance and bearing.
This class provides methods for converting between Maidenhead Locators and Latitude/Longitude in degrees as well as for calculating the distance and bearing between two positions. This type of locator is mainly used in amateur radio and sometimes also called “QRA locator”.
This class is based on a Perl module by Dirk Koopman, G1TLH.
Maidenhead locator calculation in Pascal? Continue to locator distance calculation…
The following sample code shows how to compute the distance between two locators:
string homeLoc = "JN59MN"
string destLoc = "JO63DH"
// Compute distance [km] and direction [°]
double distance = MaidenheadLocator.Distance(homeLoc, destLoc);
double azimuth = MaidenheadLocator.Azimuth(homeLoc, destLoc);
// Convert locator to latitude/longitude
LatLng homeLL = MaidenheadLocator.LocatorToLatLng(homeLoc);
// Convert latitude/longitude to locator
string myLoc = MaidenheadLocator.LatLngToLocator(49.57, 11.08);
MaidenheadLocator.cs9.5 KiBSource code of the MaidenheadLocator class
LatLngumbenannt (wie im Google-Maps-API).
Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty. (GNU All-Permissive licence)
- Created on 2007-04-02, updated on 2015-03-01.
- First used in ARLog: Amateur Radio Logbook.
- Ca. 170 lines of code, estimated development costs: 170 - 680 €