Class MaidenheadLocatorConversion

java.lang.Object
uk.m0nom.adifproc.maidenheadlocator.MaidenheadLocatorConversion

public class MaidenheadLocatorConversion extends Object
Converted from C# source code by Mark Wickens M0NOM, credits and license below

Copyright (c) 2011, Yves Goergen, ... 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. This class is based on a Perl module by Dirk Koopman, G1TLH, from 2002-11-07. Source: ...

  • Field Details

    • LOC_4CHAR

      public static final Pattern LOC_4CHAR
    • LOC_6CHAR

      public static final Pattern LOC_6CHAR
    • LOC_8CHAR

      public static final Pattern LOC_8CHAR
    • LOC_10CHAR

      public static final Pattern LOC_10CHAR
    • LOC_12CHAR

      public static final Pattern LOC_12CHAR
  • Constructor Details

    • MaidenheadLocatorConversion

      public MaidenheadLocatorConversion()
  • Method Details

    • isADubiousGridSquare

      public static boolean isADubiousGridSquare(String grid)
    • isEmptyOrInvalid

      public static boolean isEmptyOrInvalid(String gridSquare)
    • isValid

      public static boolean isValid(String gridSquare)
    • locatorToCoords

      public static GlobalCoords3D locatorToCoords(LocationSource source, String locStr)
    • locatorToCoords

      public static GlobalCoords3D locatorToCoords(LocationSource source, String locStr, String extStr)
    • coordsToLocator

      public static String coordsToLocator(org.gavaghan.geodesy.GlobalCoordinates coords)
      Converts latitude and longitude in degrees to a locator
      Parameters:
      coords - GlobalCoordinates structure to convert
      Returns:
      Locator string
    • locationParserResultToLocator

      public static String locationParserResultToLocator(LocationParserResult result)
    • coordsToLocator

      public static String coordsToLocator(org.gavaghan.geodesy.GlobalCoordinates coords, int len)
      Convert latitude and longitude in degrees to a locator
      Parameters:
      coords - GlobalCoordinates structure to convert
      len - Length of the locator (4/6/8/10)
      Returns:
      Locator string
    • distance

      public static double distance(String a, String b)
      Calculate the distance in km between two locators
      Parameters:
      a - Start locator string
      b - End locator string
      Returns:
      Distance in km
    • distance

      public static double distance(org.gavaghan.geodesy.GlobalCoordinates a, org.gavaghan.geodesy.GlobalCoordinates b)
      Calculate the distance in km between two locators
      Parameters:
      a - Start GlobalCoordinates structure
      b - End GlobalCoordinates structure
      Returns:
      Distance in km
    • azimuth

      public static double azimuth(String a, String b)
      Calculate the azimuth in degrees between two locators
      Parameters:
      a - Start locator string
      b - End locator string
      Returns:
      Azimuth in degrees
    • azimuth

      public static double azimuth(org.gavaghan.geodesy.GlobalCoordinates a, org.gavaghan.geodesy.GlobalCoordinates b)
      Calculate the azimuth in degrees between two locators
      Parameters:
      a - Start GlobalCoordinates structure
      b - End GlobalCoordinates structure
      Returns:
      azimuth in degrees
    • isAWellFormedGridsquare

      public static boolean isAWellFormedGridsquare(String locStr)