public class GEOLocationElement extends ANQPElement
Section 8.4.2.24.10 of the IEEE802.11-2012 specification refers to RFC-3825 for the format of the Geospatial location information. RFC-3825 has subsequently been obsoleted by RFC-6225 which defines the same basic binary format for the DHCPv4 payload except that a few unused bits of the Datum field have been reserved for other uses.
RFC-3825 defines a resolution field for each of latitude, longitude and altitude as "the number of significant bits" of precision in the respective values and implies through examples and otherwise that the non-significant bits should be simply disregarded and the range of values are calculated as the numeric interval obtained by varying the range of "insignificant bits" between its extremes. As a simple example, consider the value 33 as a simple 8-bit number with three significant bits: 33 is 00100001 binary and the leading 001 are the significant bits. With the above definition, the range of numbers are [32,63] with 33 asymmetrically located at the low end of the interval. In a more realistic setting an instrument, such as a GPS, would most likely deliver measurements with a gaussian distribution around the exact value, meaning it is more reasonable to assume the value as a "center" value with a symmetric uncertainty interval. RFC-6225 redefines the "resolution" from RFC-3825 with an "uncertainty" value with these properties, which is also the definition suggested here.
The res fields provides the resolution as the exponent to a power of two, e.g. 8 means 2^8 = +/- 256, 0 means 2^0 = +/- 1 and -7 means 2^-7 +/- 0.00781250. Unknown resolution is indicated by not setting the respective resolution field in the RealValue.
Modifier and Type | Class and Description |
---|---|
static class |
GEOLocationElement.AltitudeType |
static class |
GEOLocationElement.Datum |
static class |
GEOLocationElement.RealValue |
Constructor and Description |
---|
GEOLocationElement(Constants.ANQPElementType infoID,
ByteBuffer payload) |
Modifier and Type | Method and Description |
---|---|
GEOLocationElement.RealValue |
getAltitude() |
GEOLocationElement.AltitudeType |
getAltitudeType() |
GEOLocationElement.Datum |
getDatum() |
GEOLocationElement.RealValue |
getLatitude() |
GEOLocationElement.RealValue |
getLongitude() |
String |
toString()
Returns a string representation of the object.
|
getID
public GEOLocationElement(Constants.ANQPElementType infoID, ByteBuffer payload) throws ProtocolException
ProtocolException
public GEOLocationElement.RealValue getLatitude()
public GEOLocationElement.RealValue getLongitude()
public GEOLocationElement.RealValue getAltitude()
public GEOLocationElement.AltitudeType getAltitudeType()
public GEOLocationElement.Datum getDatum()
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())