public class TLcdUPSUtil extends Object
An example of a UPS string is "Z 2181646 1704304"
. This String has the following
components :
"Z"
.
Note : The UPS strings formatted and parsed by this class are no UPS Mgrs
Strings. To format or parse UPS Mgrs strings, see TLcdUpsMgrsUtil
.
Constructor and Description |
---|
TLcdUPSUtil()
Creates a new
TLcdUPSUtil instance that uses the WGS_84 ellipsoid for its
calculations. |
TLcdUPSUtil(ILcdEllipsoid aEllipsoid)
Creates a new
TLcdUPSUtil instance that uses the given ellipsoid for its
calculations. |
Modifier and Type | Method and Description |
---|---|
int |
getNumberOfDigits()
Returns the number of digits used to format a UPS String.
|
char |
getUPSCoordinateSeparator()
Returns the character to separate the zone/grid letters and the coordinates.
|
String |
lonLat2Ups(ILcdPoint aLonLatPoint)
This method converts the given lon lat point to a UPS String.
|
void |
setNumberOfDigits(int aNumberOfDigits)
Sets the number of digits used to format a UPS String.
|
void |
setUPSCoordinateSeparator(char aUPSCoordinateSeparator)
Set the character to separate the zone/grid letters and the coordinates and between the coordinates.
|
void |
ups2LonLat(String aUpsString,
ILcd2DEditablePoint a2DPointSFCT)
Finds the geodetic coordinate associated with the given UPS formatted string.
|
String |
upsXY2Ups(double aEasting,
double aNorthing,
boolean aNorthPole)
Returns the formatted notation for a given coordinate within the Universal Polar Stereographic
grid system.
|
public TLcdUPSUtil()
TLcdUPSUtil
instance that uses the WGS_84 ellipsoid for its
calculations.public TLcdUPSUtil(ILcdEllipsoid aEllipsoid)
TLcdUPSUtil
instance that uses the given ellipsoid for its
calculations.aEllipsoid
- a given ellipsoid.public char getUPSCoordinateSeparator()
setUPSCoordinateSeparator(char)
public void setUPSCoordinateSeparator(char aUPSCoordinateSeparator)
' '
(a space).aUPSCoordinateSeparator
- the character to separate the zone/grid letters and the coordinates
and between the coordinates.getUPSCoordinateSeparator()
public int getNumberOfDigits()
setNumberOfDigits(int)
public void setNumberOfDigits(int aNumberOfDigits)
By default, no fixed number of digits is used. E.g.
"Z 2181646 1704304"
7
, the same point will be formatted as "Z 2181646 1704304"
4
, the same point will be formatted as "Z 2181 1704"
aNumberOfDigits
- the number of digits used to format a String.public String lonLat2Ups(ILcdPoint aLonLatPoint) throws TLcdOutOfBoundsException
aLonLatPoint
- a lon lat point.TLcdOutOfBoundsException
- when the given point is outside the UPS bounds.public void ups2LonLat(String aUpsString, ILcd2DEditablePoint a2DPointSFCT) throws ParseException
aUpsString
- a UPS formatted string.a2DPointSFCT
- a geodetic point that will be set to the coordinates of the given StringParseException
- if aUpsString is not a valid UPS String.public String upsXY2Ups(double aEasting, double aNorthing, boolean aNorthPole) throws TLcdOutOfBoundsException
aEasting
- the easting of the coordinate.aNorthing
- the northing of the coordinate.aNorthPole
- if true, the coordinate is specified within the northern UPS grid system,
and within the southern UPS grid system otherwise.TLcdOutOfBoundsException
- if the coordinate is out of bounds.