Package ucar.unidata.view.geoloc
Class CoordinateFormat
java.lang.Object
ucar.unidata.view.geoloc.CoordinateFormat
The CoordinateFormat class to format geo coordinates.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumThe Cardinality enum.static classThe DecimalCoordFormat.static enumThe Degrees Minutes Seconds enum.static classThe FloorCoordFormat class.static interfaceThe Format interface.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic Stringconvert(double coord, CoordinateFormat.Format degF, CoordinateFormat.Format minF, CoordinateFormat.Format secF, CoordinateFormat.Cardinality card) Convert a decimal coordinate.static StringformatLatitude(double value, String format) Format a longitude to the given format.static StringformatLongitude(double value, String format, boolean use360) Format a latitude or longitude value to the given format.
- 
Field Details- 
EMPTY_FORMATEmpty format.
 
- 
- 
Constructor Details- 
CoordinateFormatpublic CoordinateFormat()
 
- 
- 
Method Details- 
convertpublic static String convert(double coord, CoordinateFormat.Format degF, CoordinateFormat.Format minF, CoordinateFormat.Format secF, CoordinateFormat.Cardinality card) Convert a decimal coordinate.- Parameters:
- coord- the decimal coord
- degF- the deg format
- minF- the min format
- secF- the sec format
- card- the cardinality
- Returns:
- the formatted coordinate string
 
- 
formatLatitudeFormat a longitude to the given format.formatLongitude(double, String, boolean)- Parameters:
- value- the value to format
- format- the format
- Returns:
- formatted latitude
 
- 
formatLongitudeFormat a latitude or longitude value to the given format. Formats use DD for degrees, MM for minutes, SS for seconds and d, m, s for decimal fractions of degrees, minutes, seconds. H designates the hemisphere (N,S,E,W).Examples for value -34.496 degrees DD:MM:SS ===> -34:29:45 (if longitude and use360 ===> 326:29:45) DDH ===> 34W (or 34S if longitude) DD.d ===> -34.5 DD.dddH ===> 34.496W (or 34.496S if longitude) DD MM'SS.s" ===> -34 29'45.6"- Parameters:
- value- the value to format
- format- the format
- use360- if true use 0-360 notation instead of -180 to 180 notation
- Returns:
- formatted longitude
 
 
-