public class TLcdUpsMgrsUtil extends Object
Constructor and Description |
---|
TLcdUpsMgrsUtil()
Creates a new
TLcdUpsMgrsUtil that uses the WGS_84 ellipsoid. |
TLcdUpsMgrsUtil(ILcdEllipsoid aEllipsoid)
Creates a new
TLcdUpsMgrsUtil that uses the given ellipsoid. |
Modifier and Type | Method and Description |
---|---|
char |
getUPSCoordinateSeparator()
Returns the character to separate the zone and the coordinates.
|
char |
getZoneSeparator()
Returns the character to separate the UPS grid zone and the 100km squares.
|
String |
lonLat2UpsMgrs(ILcdPoint aLonLatPoint,
int aNumberOfDigits)
Converts a lon-lat point (WGS84) into Military Grid
System coordinates
for a UPS projection. |
void |
setUPSCoordinateSeparator(char aUPSCoordinateSeparator)
Set the character to separate the zone and the coordinates and between the coordinates.
|
void |
setZoneSeparator(char aZoneSeparator)
Sets the character to use as separator between the UPS grid zone and the 100km squares.
|
void |
upsMgrs2LonLat(String aUpsMgrsCell,
ILcd2DEditablePoint a2DPointSFCT)
Finds the geodetic coordinates of the lower-left corner of a square
cell expressed in the MGRS Universal polar Stereographic notation.
|
void |
upsMgrs2UpsXY(String aUpsMgrsCell,
ILcd2DEditablePoint a2DPointSFCT)
Finds the grid coordinates of the lower-left corner of a square
cell expressed in the MGRS Universal polar Stereographic notation.
|
String |
upsXY2UpsMgrs(double aEasting,
double aNorthing,
boolean aNorthernHemisphere,
int aNumberOfDigits)
Returns the MGRS formatted notation for a given coordinate within the Universal Polar Stereographic
grid system.
|
public TLcdUpsMgrsUtil()
TLcdUpsMgrsUtil
that uses the WGS_84 ellipsoid.public TLcdUpsMgrsUtil(ILcdEllipsoid aEllipsoid)
TLcdUpsMgrsUtil
that uses the given ellipsoid.aEllipsoid
- a given ellipsoid.public char getUPSCoordinateSeparator()
setUPSCoordinateSeparator(char)
public void setUPSCoordinateSeparator(char aUPSCoordinateSeparator)
aUPSCoordinateSeparator
- the character to separate the zone and the coordinates and between the coordinates.getUPSCoordinateSeparator()
public char getZoneSeparator()
setZoneSeparator(char)
public void setZoneSeparator(char aZoneSeparator)
Sets the character to use as separator between the UPS grid zone and the 100km squares.
Set the value to 0
(not the character '0'
) to have no separator
between the UPS grid zone and the 100km squares.
The default is 0
.
aZoneSeparator
- the character to separate the UPS grid zone and the 100km squares.getZoneSeparator()
public String lonLat2UpsMgrs(ILcdPoint aLonLatPoint, int aNumberOfDigits) throws TLcdOutOfBoundsException
System
coordinates
for a UPS 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.
aLonLatPoint
- ILcdPoint
to be converted. The point has to be specified within WGS84!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 UPS-MGRS coordinates.TLcdOutOfBoundsException
- if the coordinate is outside the bounds.public String upsXY2UpsMgrs(double aEasting, double aNorthing, boolean aNorthernHemisphere, int aNumberOfDigits) throws TLcdOutOfBoundsException
aEasting
- the easting of the coordinate.aNorthing
- the northing of the coordinate.aNorthernHemisphere
- if true, the coordinate is specified within the northern UPS grid system,
and within the southern UPS grid system otherwise.aNumberOfDigits
- the number of digits to use with a 100000 meter block.TLcdOutOfBoundsException
- if the coordinate is out of bounds.public void upsMgrs2LonLat(String aUpsMgrsCell, ILcd2DEditablePoint a2DPointSFCT) throws ParseException
aUpsMgrsCell
- the cella2DPointSFCT
- a lon/lat point that will be set to the coordinates of
the lower-left corner of the cellParseException
- if aUpsMgrsCell is not a valid cell identifierpublic void upsMgrs2UpsXY(String aUpsMgrsCell, ILcd2DEditablePoint a2DPointSFCT) throws ParseException
aUpsMgrsCell
- the cella2DPointSFCT
- a grid point that will be set to the coordinates of
the lower-left corner of the cellParseException
- if aUpsMgrsCell is not a valid cell identifier