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.Constructor and Description |
---|
TLcdUtmMgrsUtil()
Creates a new
TLcdUtmMgrsUtil that uses the WGS_84 ellipsoid. |
TLcdUtmMgrsUtil(ILcdEllipsoid aEllipsoid)
Creates a new
TLcdUtmMgrsUtil that uses the given ellipsoid. |
Modifier and Type | Method and Description |
---|---|
char |
getUTMCoordinateSeparator()
Returns the character to separate the 100 km square letters and the coordinates.
|
char |
getZoneSeparator()
Returns the character to separate the UTM grid zone and the 100km squares.
|
String |
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.
|
ILcd2DEditablePoint |
utmMgrs2LonLat(String aString)
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.
|
String |
utmXY2UtmMgrs(double aEasting,
double aNorthing,
int aZone,
boolean aNorthernHemisphere,
int aNumberOfDigits)
Converts an utm point into Military Grid
System coordinates
for a UTM projection. |
public TLcdUtmMgrsUtil()
TLcdUtmMgrsUtil
that uses the WGS_84 ellipsoid.public TLcdUtmMgrsUtil(ILcdEllipsoid aEllipsoid)
TLcdUtmMgrsUtil
that uses the given ellipsoid.aEllipsoid
- a given ellipsoid.public ILcd2DEditablePoint utmMgrs2LonLat(String aString) throws ParseException
aString
- the square cell.ParseException
- if the given String is not a valid cell identifier.public char getUTMCoordinateSeparator()
setUTMCoordinateSeparator(char)
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
.
aUTMCoordinateSeparator
- the character to separate the zone and the coordinates and between the coordinates.getUTMCoordinateSeparator()
public char getZoneSeparator()
setZoneSeparator(char)
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
.
aZoneSeparator
- the character to separate the UTM grid zone and the 100km squares.getZoneSeparator()
public String lonLat2UtmMgrs(ILcdPoint aLLP, int aNumberOfDigits) throws TLcdOutOfBoundsException
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.
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).
String
representing the coordinates in UTM-MGRS coordinates.TLcdOutOfBoundsException
- if the coordinate is outside the valid area of the UTM projection.TLcdUTMGridSystem.inLonLatBounds(com.luciad.shape.ILcdPoint)
public String utmXY2UtmMgrs(double aEasting, double aNorthing, int aZone, boolean aNorthernHemisphere, int aNumberOfDigits) throws TLcdOutOfBoundsException
System
coordinates
for a UTM projection.
See lonLat2UtmMgrs
for more information.aEasting
- the eastingaNorthing
- the northingaZone
- the utm zoneaNorthernHemisphere
- 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).
String
representing the coordinates in UTM-MGRS coordinates.TLcdOutOfBoundsException
- if the coordinate is outside the valid area of the UTM projection.TLcdUTMGridSystem.inLonLatBounds(com.luciad.shape.ILcdPoint)
public void utmMgrs2UtmXY(String aString, ILcd2DEditablePoint a2DPointSFCT) throws ParseException
aString
- the square cell.a2DPointSFCT
- the point in which to store the UTM coordinate.ParseException
- if the given String is not a valid cell identifier.