public class IlvUTMCoordinateFormatter extends IlvAbstractCoordinateFormatter
MGRS 60 V WQ 77438 21254
.UTM 60 V 3277438 1221254
.This formater is only able to parse coordinates from an UTM coordinate string.
,
Serialized FormConstructor and Description |
---|
IlvUTMCoordinateFormatter()
Public constructor, using a default WGS84 ellipsoid
|
IlvUTMCoordinateFormatter(IlvInputStream stream)
Creates a new
IlvUTMCoordinateFormatter from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
Overrides deep comparison equals.
|
String |
getAngleString(double angleRad)
This method is not supported by this coordinate formatter
|
double |
getEasting()
Returns the easting of the current point.
|
double |
getLatitude()
Returns the latitude of current point.
|
double |
getLongitude()
Returns the longitude of current point.
|
double |
getNorthing()
Returns the northing of the current point.
|
char |
getZoneLetter()
Returns the zone letter of the current point.
|
int |
getZoneNumber()
Returns the zone number of the current point.
|
boolean |
isMGRSOutput()
Indicates whether the coordinate output is UTM or MGRS.
|
void |
parse(String coordinatesString)
Parse a formatted string containing a point's coordinates in this system
|
void |
setEllipsoid(IlvEllipsoid el)
This method does nothing for UTM (Ellipsoid must be WGS84).
|
void |
setLonLat(double longitude,
double latitude)
Sets latitude and longitude of the current point.
|
void |
setMGRSOutput(boolean outputAsMGRS)
Indicates whether the coordinate output are UTM or MGRS.
|
protected void |
setupFormatters()
This method is called after precision has been changed and should update
the internal number formatters, if any.
|
void |
setUTMPoint(double easting,
double northing,
int zNumber,
char zLetter)
Sets a point in UTM coordinates
|
String |
toString()
Returns the string representation of current point in this system.
|
void |
write(IlvOutputStream stream)
Writes the attributes of a persistent object.
|
getDecimalFormatSymbols, getEllipsoid, getInputSeparator, getOutputSeparator, getPrecision, hashCode, setCoordinatePrecision, setOutputSeparator, setParseSeparator, setPrecision
public IlvUTMCoordinateFormatter()
public IlvUTMCoordinateFormatter(IlvInputStream stream) throws IlvReadFileException
IlvUTMCoordinateFormatter
from an
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if an error occurs while reading.public void setEllipsoid(IlvEllipsoid el)
setEllipsoid
in interface IlvCoordinateFormatter
setEllipsoid
in class IlvAbstractCoordinateFormatter
el
- ellipsoid to use for conversions.IlvAbstractCoordinateFormatter.setEllipsoid(ilog.views.maps.projection.IlvEllipsoid)
public void write(IlvOutputStream stream) throws IOException
write
in interface IlvPersistentObject
write
in class IlvAbstractCoordinateFormatter
stream
- the output streamIOException
- thrown when an exception occurs during
the write operation for this object.IlvPersistentObject.write(ilog.views.io.IlvOutputStream)
public double getEasting() throws IllegalStateException
IllegalStateException
- if coordinates were not set first on the systempublic double getLatitude() throws IllegalStateException
IllegalStateException
- if coordinates were not set first on the systempublic double getLongitude() throws IllegalStateException
IllegalStateException
- if coordinates were not set first on the systempublic double getNorthing() throws IllegalStateException
IllegalStateException
- if coordinates were not set first on the systempublic char getZoneLetter() throws IllegalStateException
IllegalStateException
- if coordinates were not set first on the systempublic int getZoneNumber() throws IllegalStateException
IllegalStateException
- if coordinates were not set first on the systempublic void parse(String coordinatesString) throws IllegalArgumentException
coordinatesString
- the String to parse.IllegalArgumentException
- if string format is not validpublic void setLonLat(double longitude, double latitude)
longitude
- longitude in radians.latitude
- latitude in radians.IlvCoordinateFormatter.setLonLat(double, double)
public void setUTMPoint(double easting, double northing, int zNumber, char zLetter)
easting
- easting of the UTM coordinatesnorthing
- northing of the UTM coordinateszNumber
- zone number of the UTM coordinateszLetter
- zone letter of the UTM coordinatespublic final boolean isMGRSOutput()
true
if coordinate output is MGRS, false
if coordinate output is UTM.public final void setMGRSOutput(boolean outputAsMGRS)
outputAsMGRS
- If true
the output coordinates are MGRS.public String toString()
toString
in interface IlvCoordinateFormatter
toString
in class Object
protected void setupFormatters()
setupFormatters
in class IlvAbstractCoordinateFormatter
IlvAbstractCoordinateFormatter.setupFormatters()
public String getAngleString(double angleRad) throws UnsupportedOperationException
angleRad
- angle in radians.UnsupportedOperationException
- if the formatter does not support angles.IlvCoordinateFormatter.getAngleString(double)
public boolean equals(Object other)
equals
in class IlvAbstractCoordinateFormatter
Object.equals(java.lang.Object)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.