public class TLcdUTMUtil extends Object
An example of a UTM String is "17T 630084 4833438"
. This String has the following
component :
"17"
.'N'
or 'S'
)is sufficient, but
often the latitude band letter is provided instead. This class offers both possibilities
(setUseLatitudeBandDesignator(boolean)
). In the example String, the latitude band
letter "T"
is used.
Note : The UTM Strings formatted and parsed by this class are no UTM Mgrs
Strings. To format or parse UTM Mgrs Strings, see TLcdUtmMgrsUtil
.
Constructor and Description |
---|
TLcdUTMUtil()
Creates a new
TLcdUTMUtil instance that uses the WGS_84 ellipsoid for its calculations. |
TLcdUTMUtil(ILcdEllipsoid aEllipsoid)
Creates a new
TLcdUTMUtil 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 UTM String.
|
char |
getUTMCoordinateSeparator()
Returns the character to separate the zone/grid letters and the coordinates.
|
boolean |
isUseLatitudeBandDesignator()
Returns if the latitude band designator is used to make sure each grid position is
defined uniquely.
|
String |
lonLat2Utm(ILcdPoint aLonLatPoint)
This method converts the given lon lat point to a UTM String.
|
void |
setNumberOfDigits(int aNumberOfDigits)
Sets the number of digits used to format a UTM String.
|
void |
setUseLatitudeBandDesignator(boolean aUseLatitudeBandDesignator)
Set to
true to use a latitude band designator to make sure that each grid
position is defined uniquely. |
void |
setUTMCoordinateSeparator(char aUTMCoordinateSeparator)
Set the character to separate the zone/grid letters and the coordinates and between the coordinates.
|
void |
utm2LonLat(String aUtmString,
ILcd2DEditablePoint a2DPointSFCT)
Finds the geodetic coordinate associated with the given UTM formatted string.
|
String |
utmXY2Utm(double aEasting,
double aNorthing,
int aZone,
boolean aNorthernHemisphere)
Converts an utm point into UTM format coordinates.
|
public TLcdUTMUtil()
TLcdUTMUtil
instance that uses the WGS_84 ellipsoid for its calculations.public TLcdUTMUtil(ILcdEllipsoid aEllipsoid)
TLcdUTMUtil
instance that uses the given ellipsoid for its calculations.aEllipsoid
- a given ellipsoid.public boolean isUseLatitudeBandDesignator()
public void setUseLatitudeBandDesignator(boolean aUseLatitudeBandDesignator)
true
to use a latitude band designator to make sure that each grid
position is defined uniquely. Set to false
to use a hemisphere designator
('S'
or 'N'
).
This value is set to true
by default.
aUseLatitudeBandDesignator
- true
to use a latitude band designator,
false
to use a hemisphere designator.public char getUTMCoordinateSeparator()
setUTMCoordinateSeparator(char)
public void setUTMCoordinateSeparator(char aUTMCoordinateSeparator)
' '
(a space).aUTMCoordinateSeparator
- the character to separate the zone/grid letters and the coordinates
and between the coordinates.getUTMCoordinateSeparator()
public int getNumberOfDigits()
setNumberOfDigits(int)
public void setNumberOfDigits(int aNumberOfDigits)
By default, no fixed number of digits is used. E.g.
"17T 630084 4833438"
7
, the same point will be formatted as "17T 0630084 4833438"
4
, the same point will be formatted as "17T 0630 4833"
aNumberOfDigits
- the number of digits used to format a String.public String lonLat2Utm(ILcdPoint aLonLatPoint) throws TLcdOutOfBoundsException
aLonLatPoint
- a lon lat point.TLcdOutOfBoundsException
- when the given point is outside the UTM bounds.public void utm2LonLat(String aUtmString, ILcd2DEditablePoint a2DPointSFCT) throws ParseException
aUtmString
- a UTM formatted string.a2DPointSFCT
- a geodetic point that will be set to the coordinates of the given StringParseException
- if aUtmString is not a valid UTM String.public String utmXY2Utm(double aEasting, double aNorthing, int aZone, boolean aNorthernHemisphere) throws TLcdOutOfBoundsException
lonLat2Utm
for more information.aEasting
- the eastingaNorthing
- the northingaZone
- the utm zoneaNorthernHemisphere
- true
if the given point lies in the northern hemisphere.String
representing the coordinates in UTM format coordinates.TLcdOutOfBoundsException
- if the coordinate is outside the valid area of the UTM projection.TLcdUTMGridSystem.inLonLatBounds(com.luciad.shape.ILcdPoint)