public class CoordinateFormat
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CoordinateFormat.Cardinality
The Cardinality enum.
|
static class |
CoordinateFormat.DecimalCoordFormat
The DecimalCoordFormat.
|
static class |
CoordinateFormat.DegMinSec
The Degrees Minutes Seconds enum.
|
static class |
CoordinateFormat.FloorCoordFormat
The FloorCoordFormat class.
|
static interface |
CoordinateFormat.Format
The Format interface.
|
| Modifier and Type | Field and Description |
|---|---|
static CoordinateFormat.Format |
EMPTY_FORMAT
Empty format.
|
| Constructor and Description |
|---|
CoordinateFormat() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
convert(double coord,
CoordinateFormat.Format degF,
CoordinateFormat.Format minF,
CoordinateFormat.Format secF,
CoordinateFormat.Cardinality card)
Convert a decimal coordinate.
|
static java.lang.String |
formatLatitude(double value,
java.lang.String format)
Format a longitude to the given format.
|
static java.lang.String |
formatLongitude(double value,
java.lang.String format,
boolean use360)
Format a latitude or longitude value to the given format.
|
public static final CoordinateFormat.Format EMPTY_FORMAT
public static java.lang.String convert(double coord,
CoordinateFormat.Format degF,
CoordinateFormat.Format minF,
CoordinateFormat.Format secF,
CoordinateFormat.Cardinality card)
coord - the decimal coorddegF - the deg formatminF - the min formatsecF - the sec formatcard - the cardinalitypublic static java.lang.String formatLatitude(double value,
java.lang.String format)
formatLongitude(double, String, boolean)value - the value to formatformat - the formatpublic static java.lang.String formatLongitude(double value,
java.lang.String format,
boolean use360)
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"
value - the value to formatformat - the formatuse360 - if true use 0-360 notation instead of -180 to 180 notation