Class TLcdGeorefUtil

java.lang.Object
com.luciad.view.map.TLcdGeorefUtil
All Implemented Interfaces:
Serializable

public class TLcdGeorefUtil extends Object implements Serializable
TLcdGeorefUtil is a utility class for the Military Georeference of a latitude-longitude pair which ia also known as the World Geographic Reference System.

The GEOREF coordinate for a position consists of a group of letters and numbers with the following format:

FGfgMMxxmmxx
  1. F is a letter identifying a fifteen degree longitudinal zone
  2. G is a letter identifying a fifteen degree latitudinal zone
  3. f is a letter identifying a one degree zone of longitude within FG
  4. g is a letter identifying a one degree zone of latitude within FG
  5. MM minutes of longitude, up to a certain precision (.xx)
  6. mm minutes of latitude up to a certain precision (.xx)
So, depending on the georef representation having four, six, eight, ten or twelve numerals corresponds to precisions up to 1 minute, 0.1 minute, 0.01, 0.001 or 0.0001 minute respectively. Note that the decimal separator is omitted in the georef notation.

See Also:
  • Constructor Details

    • TLcdGeorefUtil

      public TLcdGeorefUtil()
  • Method Details

    • georef2LonLat

      public static ILcd2DEditablePoint georef2LonLat(String aGeoRefString) throws ParseException
      Converts a GEOREF coordinate into a ILcd2DEditablePoint. The GEOREF coordinate for a position consists of a group of letters and numbers with the following format:
      FGfgMMxxmmxx
      1. F is a letter identifying a fifteen degree longitudinal zone
      2. G is a letter identifying a fifteen degree latitudinal zone
      3. f is a letter identifying a one degree zone of longitude within FG
      4. g is a letter identifying a one degree zone of latitude within FG
      5. MM minutes of longitude, up to a certain precision (.xx)
      6. mm minutes of latitude up to a certain precision (.xx)
      So, depending on the georef representation having four, six, eight, ten or twelve numerals corresponds to precisions up to 1 minute, 0.1 minute, 0.01, 0.001 or 0.0001 minute respectively. Note that the decimal separator is omitted in the georef notation.
      Parameters:
      aGeoRefString - string representation of GEOREF coordinate.
      Returns:
      ILcd2DEditablePoint that corresponds to aGeoRefString.
      Throws:
      ParseException - aGeoRefString is not a valid representation of a Georef coordinate.
    • lonLat2Georef

      public static String lonLat2Georef(double aLongitude, double aLatitude, int aNumberOfDigits)
      Converts a lon-lat point into GEOREF coordinates. The GEOREF coordinate for a position consists of a group of letters and numbers with the following format:
      FGfgMMxxmmxx
      1. F is a letter identifying a fifteen degree longitudinal zone
      2. G is a letter identifying a fifteen degree latitudinal zone
      3. f is a letter identifying a one degree zone of longitude within FG
      4. g is a letter identifying a one degree zone of latitude within FG
      5. MM minutes of longitude, up to a certain precision (.xx)
      6. mm minutes of latitude up to a certain precision (.xx)
      So, depending on the georef representation having four, six, eight, ten or twelve numerals corresponds to precisions up to 1 minute, 0.1 minute, 0.01, 0.001 or 0.0001 minute respectively. Note that the decimal separator is omitted in the georef notation.
      Parameters:
      aLongitude - decimal longitude of lon-lat point to be converted.
      aLatitude - decimal latitude of lon-lat point to be converted.
      aNumberOfDigits - defines the precision as the number of digits after the decimal point of the minutes (MM.xx and mm.xx). It must be a value between 0 and 4 inclusive corresponding to a precision of 1 minute up to 0.0001 minutes respectively.
      Returns:
      String representation of GEOREF coordinate of aLongitude,aLatitude.