Class TLcdUtmMgrsUtil

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

public class TLcdUtmMgrsUtil extends Object implements Serializable
TLcdUtmMgrsUtil is a utility class for the UTM Military Grid Reference, which is an alphanumeric version of a numerical UTM (Universal Transverse Mercator) grid coordinate.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new TLcdUtmMgrsUtil that uses the WGS_84 ellipsoid.
    Creates a new TLcdUtmMgrsUtil that uses the given ellipsoid.
  • Method Summary

    Modifier and Type
    Method
    Description
    char
    Returns the character to separate the 100 km square letters and the coordinates.
    char
    Returns the character to separate the UTM grid zone and the 100km squares.
    lonLat2UtmMgrs(ILcdPoint aLLP, int aNumberOfDigits)
    Converts a lon-lat point into Military Grid System coordinates for a UTM projection.
    void
    setUTMCoordinateSeparator(char aUTMCoordinateSeparator)
    Set the character to use as separator between the 100 km square letters and the grid coordinates and between both grid coordinates.
    void
    setZoneSeparator(char aZoneSeparator)
    Sets the character to use as separator between the UTM grid zone and the 100km squares.
    Finds the geodetic coordinate of a point in the square cell expressed in MGRS UTM notation.
    void
    utmMgrs2UtmXY(String aString, ILcd2DEditablePoint a2DPointSFCT)
    Finds the UTM coordinate of a point in the square cell expressed in MGRS UTM notation.
    utmXY2UtmMgrs(double aEasting, double aNorthing, int aZone, boolean aNorthernHemisphere, int aNumberOfDigits)
    Converts an utm point into Military Grid System coordinates for a UTM projection.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TLcdUtmMgrsUtil

      public TLcdUtmMgrsUtil()
      Creates a new TLcdUtmMgrsUtil that uses the WGS_84 ellipsoid.
    • TLcdUtmMgrsUtil

      public TLcdUtmMgrsUtil(ILcdEllipsoid aEllipsoid)
      Creates a new TLcdUtmMgrsUtil that uses the given ellipsoid.
      Parameters:
      aEllipsoid - a given ellipsoid.
  • Method Details

    • utmMgrs2LonLat

      public ILcd2DEditablePoint utmMgrs2LonLat(String aString) throws ParseException
      Finds the geodetic coordinate of a point in the square cell expressed in MGRS UTM notation.
      Parameters:
      aString - the square cell.
      Returns:
      the geodetic coordinate of a point in the given square cell.
      Throws:
      ParseException - if the given String is not a valid cell identifier.
    • getUTMCoordinateSeparator

      public char getUTMCoordinateSeparator()
      Returns the character to separate the 100 km square letters and the coordinates.
      Returns:
      the character to separate the 100 km square letters and the coordinates.
      See Also:
    • setUTMCoordinateSeparator

      public void setUTMCoordinateSeparator(char aUTMCoordinateSeparator)

      Set the character to use as separator between the 100 km square letters and the grid coordinates and between both grid coordinates. Set the value to 0 (not the character '0') to have no separator.

      The default is 0.

      Parameters:
      aUTMCoordinateSeparator - the character to separate the zone and the coordinates and between the coordinates.
      See Also:
    • getZoneSeparator

      public char getZoneSeparator()
      Returns the character to separate the UTM grid zone and the 100km squares.
      Returns:
      the character to separate the UTM grid zone and the 100km squares.
      See Also:
    • setZoneSeparator

      public void setZoneSeparator(char aZoneSeparator)

      Sets the character to use as separator between the UTM grid zone and the 100km squares. Set the value to 0 (not the character '0') to have no separator between the UTM grid zone and the 100km squares.

      The default is 0.

      Parameters:
      aZoneSeparator - the character to separate the UTM grid zone and the 100km squares.
      See Also:
    • lonLat2UtmMgrs

      public String lonLat2UtmMgrs(ILcdPoint aLLP, int aNumberOfDigits) throws TLcdOutOfBoundsException
      Converts a lon-lat point into Military Grid System coordinates for a UTM projection. The MGRS coordinate for a position consists of a group of letters and numbers which include the following elements:

      1. The Grid Zone Designation.

      2. The 100,000-meter square letter identification.

      3. The grid coordinates (also referred to as rectangular coordinates); the numerical portion of the reference expressed to a desired refinement.

      A reference is written as an entity without spaces, parentheses, dashes, or decimal points.

      Parameters:
      aLLP - ILcd2DEditablePoint to be converted.
      aNumberOfDigits - defines the precision as the number of digits in the rectangular coordinates; must be a value between 0 and 5 inclusive:

      0: 4QFJ (Locating a point within a 100,000-meter square)

      1: 4QFJ16 (Locating a point within a 10,000-meter square)

      2: 4QFJ1267 (Locating a point within a 1,000-meter square)

      3: 4QFJ123678 (Locating a point within a 100-meter square)

      4: 4QFJ12346789 (Locating a point within a 10-meter square)

      5: 4QFJ1234567890 (Locating a point within a 1-meter square).

      Returns:
      a String representing the coordinates in UTM-MGRS coordinates.
      Throws:
      TLcdOutOfBoundsException - if the coordinate is outside the valid area of the UTM projection.
      See Also:
    • utmXY2UtmMgrs

      public String utmXY2UtmMgrs(double aEasting, double aNorthing, int aZone, boolean aNorthernHemisphere, int aNumberOfDigits) throws TLcdOutOfBoundsException
      Converts an utm point into Military Grid System coordinates for a UTM projection.

      See lonLat2UtmMgrs for more information.

      Parameters:
      aEasting - the easting
      aNorthing - the northing
      aZone - the utm zone
      aNorthernHemisphere - true if the given point lies in the northern hemisphere.
      aNumberOfDigits - defines the precision as the number of digits in the rectangular coordinates; must be a value between 0 and 5 inclusive:

      0: 4QFJ (Locating a point within a 100,000-meter square)

      1: 4QFJ16 (Locating a point within a 10,000-meter square)

      2: 4QFJ1267 (Locating a point within a 1,000-meter square)

      3: 4QFJ123678 (Locating a point within a 100-meter square)

      4: 4QFJ12346789 (Locating a point within a 10-meter square)

      5: 4QFJ1234567890 (Locating a point within a 1-meter square).

      Returns:
      a String representing the coordinates in UTM-MGRS coordinates.
      Throws:
      TLcdOutOfBoundsException - if the coordinate is outside the valid area of the UTM projection.
      See Also:
    • utmMgrs2UtmXY

      public void utmMgrs2UtmXY(String aString, ILcd2DEditablePoint a2DPointSFCT) throws ParseException
      Finds the UTM coordinate of a point in the square cell expressed in MGRS UTM notation.
      Parameters:
      aString - the square cell.
      a2DPointSFCT - the point in which to store the UTM coordinate.
      Throws:
      ParseException - if the given String is not a valid cell identifier.