public interface GlobeCoordinatesValue extends Value
Altitude is not supported in this value.
All numeric data in coordinates is represented by limited-precision decimal
numbers: they are given as long integers that should be divided by 10^9 to
obtain the actual value in degrees. In other words, all numbers here are
measured in nanodegrees (degrees * 10^-9). The precision constants
PREC_DEGREE etc. should be used as suitable
factors to transform numbers to this format rather than writing long
constants in code. For example, the value of 23.567 degrees in nanodegrees is
obtained by multiplying 23567 with
PREC_MILLI_DEGREE.
Limited precision is acceptable here, because (1) coordinates are naturally of limited precision, already because the whole coordinate system makes simplifying assumptions about the shape of the body it refers to; (2) exact calculations with coordinates are not needed in most applications; (4) exact comparisons of coordinate objects, although rare in practice, should still work as expected.
The one general problem with any underlying number format is the conversion between degrees (with fraction) and a degrees-minute-second view, which will always lead to a loss in precision that one has to live with. All values should be rounded to 9 significant digits after the dot.
Precision is measured in degrees, for convenience of use, but only some values are allowed there. The constants defined in this interface are based on what is supported by the Wikibase user interface.
| Modifier and Type | Field and Description |
|---|---|
static String |
GLOBE_EARTH
IRI of the earth.
|
static long |
PREC_ARCMINUTE
Precision constant for globe coordinates that are precise to the
arcminute.
|
static long |
PREC_ARCSECOND
Precision constant for globe coordinates that are precise to the
arcsecond.
|
static long |
PREC_CENTI_ARCSECOND
Precision constant for globe coordinates that are precise to the
hundredth of an arcsecond.
|
static long |
PREC_CENTI_DEGREE
Precision constant for globe coordinates that are precise to the
hundredth of a degree.
|
static long |
PREC_DECI_ARCSECOND
Precision constant for globe coordinates that are precise to the tenth of
an arcsecond.
|
static long |
PREC_DECI_DEGREE
Precision constant for globe coordinates that are precise to the tenth of
a degree.
|
static long |
PREC_DEGREE
Precision constant for globe coordinates that are precise to the degree.
|
static long |
PREC_HUNDRED_MICRO_DEGREE
Precision constant for globe coordinates that are precise to the
ten-thousandth of a degree.
|
static long |
PREC_MICRO_DEGREE
Precision constant for globe coordinates that are precise to the
millionth of a degree.
|
static long |
PREC_MILLI_ARCSECOND
Precision constant for globe coordinates that are precise to the
thousandth of an arcsecond.
|
static long |
PREC_MILLI_DEGREE
Precision constant for globe coordinates that are precise to the
thousandth of a degree.
|
static long |
PREC_TEN_DEGREE
Precision constant for globe coordinates that are precise to ten degrees.
|
static long |
PREC_TEN_MICRO_DEGREE
Precision constant for globe coordinates that are precise to the
hundred-thousandth of a degree.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getGlobe()
Get the IRI of the globe that these coordinates refer to.
|
long |
getLatitude()
Get the latitude of this value in nanodegrees.
|
long |
getLongitude()
Get the longitude of this value in nanodegrees.
|
long |
getPrecision()
Get the precision of the value in nanodegrees.
|
static final long PREC_TEN_DEGREE
static final long PREC_DEGREE
static final long PREC_DECI_DEGREE
static final long PREC_ARCMINUTE
static final long PREC_CENTI_DEGREE
static final long PREC_MILLI_DEGREE
static final long PREC_ARCSECOND
static final long PREC_HUNDRED_MICRO_DEGREE
static final long PREC_DECI_ARCSECOND
static final long PREC_TEN_MICRO_DEGREE
static final long PREC_CENTI_ARCSECOND
static final long PREC_MICRO_DEGREE
static final long PREC_MILLI_ARCSECOND
static final String GLOBE_EARTH
long getLatitude()
long getLongitude()
long getPrecision()
String getGlobe()
GLOBE_EARTH.Copyright © 2014 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage