This utility implements the IARU R1 VHF Locator as defined in the IARU R1 VHF Handbook.
This function decodes a locator. The locator can have variable length, e.g. JN18DU or JN18DU55IX.
It returns a dictionary with the following keys:
long_centroid
: Longitude of centroidlat_centroid
: Latitude of centroidlong_west
: Western Longitude of boundary box ("squaroid") of locatorlong_east
: Eastern Longitude of boundary box ("squaroid") of locatorlat_south
: Southern Latitude of boundary box ("squaroid") of locatorlat_north
: Northern Laiitude of boundary box ("squaroid") of locator
This function encodes locator, thus it returns a string with given length. The parameters are:
longitude
: The longitude from -180 to 180. West is positive.latitude
: The latitude from -90 to 90. North is positive.length
: The length of the locator. Length must an even integer of six or more
The main code of locator.py implements these functions with some demo code.