public class IlvDMSCoordinateFormatter extends IlvAbstractCoordinateFormatter
N64&B0;53'12.09" E167&B0;47'06.84"
.
If the coordinates cannot be parsed using default mechanism, IlvProjectionUtil.DMSToRadian(java.lang.String)
will be used as fall back parser.
Ellipsoid is not used in this implementation of IlvCoordinateFormatter.Constructor and Description |
---|
IlvDMSCoordinateFormatter()
Default constructor
|
IlvDMSCoordinateFormatter(IlvInputStream stream)
Creates a new
IlvDecimalCoordinateFormatter from an
IlvInputStream . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
Overrides deep comparison equals.
|
String |
getAngleString(double angleRad)
Formats a single angle.
|
double |
getLatitude()
Returns the latitude of current point.
|
int |
getLatitudeDegrees()
Returns the longitude of current point.
|
int |
getLatitudeMinutes()
Returns the latitude minutes.
|
double |
getLatitudeSeconds()
Returns the latitude seconds.
|
String |
getLatitudeString()
Returns the latitude string.
|
double |
getLongitude()
Returns the longitude of current point.
|
int |
getLongitudeDegrees()
Returns the longitude in degrees.
|
int |
getLongitudeMinutes()
Returns the longitude minutes.
|
double |
getLongitudeSeconds()
Returns the longitude seconds.
|
String |
getLongitudeString()
Returns the longitude string.
|
boolean |
isEast()
Returns whether the point longitude is towards east (or west if false).
|
boolean |
isNorth()
Returns whether the point latitude is towards north (or south if false).
|
void |
parse(String pointString)
Parse a formatted string containing a point's coordinates in this system
|
void |
setLonLat(double longitude,
double latitude)
Sets latitude and longitude of the current point.
|
void |
setLonLatDMS(int longitudeDegrees,
int longitudeMinutes,
double longitudeSeconds,
boolean east,
int latitudeDegrees,
int latitudeMinutes,
double latitudeSeconds,
boolean north)
Sets a point in Degree-Minute-Second coordinates
|
protected void |
setupFormatters()
This method is called after precision has been changed and should update
the internal number formatters, if any.
|
String |
toString()
Returns the string representation of current point in this system.
|
getDecimalFormatSymbols, getEllipsoid, getInputSeparator, getOutputSeparator, getPrecision, hashCode, setCoordinatePrecision, setEllipsoid, setOutputSeparator, setParseSeparator, setPrecision, write
public IlvDMSCoordinateFormatter()
public IlvDMSCoordinateFormatter(IlvInputStream stream) throws IlvReadFileException
IlvDecimalCoordinateFormatter
from an
IlvInputStream
.stream
- The input stream.IlvReadFileException
- if an error occurs while reading.public double getLatitude() throws IllegalStateException
IllegalStateException
- if coordinates were not set first on the systempublic int getLatitudeDegrees()
IllegalStateException
- if coordinates were not set first on the systempublic int getLatitudeMinutes()
public double getLatitudeSeconds()
public String getLatitudeString()
public double getLongitude() throws IllegalStateException
IllegalStateException
- if coordinates were not set first on the systempublic int getLongitudeDegrees()
public int getLongitudeMinutes()
public double getLongitudeSeconds()
public String getLongitudeString()
public boolean isEast()
public boolean isNorth()
public void parse(String pointString) throws IllegalArgumentException
pointString
- 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 setLonLatDMS(int longitudeDegrees, int longitudeMinutes, double longitudeSeconds, boolean east, int latitudeDegrees, int latitudeMinutes, double latitudeSeconds, boolean north)
longitudeDegrees
- longitude degreeslongitudeMinutes
- longitude minuteslongitudeSeconds
- longitude secondseast
- is longitude east or westlatitudeDegrees
- latitude degreeslatitudeMinutes
- latitude minuteslatitudeSeconds
- latitude secondsnorth
- is latitude north or southpublic 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.