Package com.skyhookwireless.wps
Class WPSLocation
- java.lang.Object
-
- com.skyhookwireless.wps.Location
-
- com.skyhookwireless.wps.WPSLocation
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class WPSLocation extends Location implements java.lang.Cloneable, java.io.Serializable
Location with WPS specific attributes- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WPSLocation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WPSLocation
clone()
double
getAGL()
double
getAGLError()
double
getAGLError(int confidence)
double
getBearing()
double
getBearingError()
double
getElevation()
java.util.Map<java.lang.String,?>
getExtras()
int
getHistoricalLocationCount()
int
getHPE()
int
getHPE(int confidence)
java.lang.String
getIp()
int
getNAP()
int
getNCell()
int
getNLac()
int
getNSat()
float
getScore()
long
getServerTimestamp()
double
getSpeed()
double
getSpeedError()
StreetAddress
getStreetAddress()
TimeZone
getTimeZone()
Venue
getVenue()
float
getVPE()
float
getVPE(int confidence)
boolean
hasAGL()
boolean
hasAGLError()
boolean
hasBearing()
boolean
hasBearingError()
boolean
hasElevation()
boolean
hasExtras()
boolean
hasHistoricalLocationCount()
boolean
hasHPE()
boolean
hasIp()
boolean
hasNAP()
boolean
hasNCell()
boolean
hasNLac()
boolean
hasNSat()
boolean
hasScore()
boolean
hasServerTimeStamp()
boolean
hasSpeed()
boolean
hasSpeedError()
boolean
hasStreetAddress()
boolean
hasTimeZone()
boolean
hasVenue()
boolean
hasVPE()
boolean
isNull()
void
setAGL(double agl)
void
setAGLError(double aglError)
void
setBearing(double bearing)
void
setBearingError(double bearingError)
void
setElevation(double elevation)
void
setExtras(java.util.Map<java.lang.String,?> extras)
void
setHistoricalLocationCount(int nloc)
void
setHPE(int hpe)
void
setNAP(int nap)
void
setNCell(int ncell)
void
setNLac(int nlac)
void
setNSat(int nsat)
void
setScore(float score)
void
setSpeed(double speed)
void
setSpeedError(double speedError)
void
setStreetAddress(StreetAddress address)
void
setTimeZone(TimeZone timeZone)
void
setVenue(Venue venue)
void
setVPE(float vpe)
java.lang.String
toString()
boolean
withIP()
-
Methods inherited from class com.skyhookwireless.wps.Location
getAltitude, getLatitude, getLongitude, getTime, hasAltitude, hasLatitude, hasLongitude, hasTime, setAltitude, setLatitude, setLongitude, setTime
-
-
-
-
Method Detail
-
getHPE
public int getHPE()
- Returns:
- A calculated error estimate (horizontal positioning error)
of the location result in meters.
Since 5.0 this value is defined as the radius of 68% confidence.
-
getHPE
public int getHPE(int confidence)
- Parameters:
confidence
- desired confidence level for the error estimate: 68%, 90% or 95%- Returns:
- A calculated error estimate (horizontal positioning error) of the location result in meters.
- Since:
- 5.11
-
hasHPE
public boolean hasHPE()
- Returns:
true
if horizontal positioning error is available- Since:
- 5.0
-
setHPE
public void setHPE(int hpe)
- Since:
- 5.0
-
getVPE
public float getVPE()
- Returns:
- A calculated error estimate (vertical positioning error) of the altitude value in meters.
- Since:
- 5.0
-
getVPE
public float getVPE(int confidence)
- Parameters:
confidence
- desired confidence level for the error estimate: 68%, 90% or 95%- Returns:
- A calculated error estimate (vertical positioning error) of the altitude value in meters.
- Since:
- 5.11
-
hasVPE
public boolean hasVPE()
- Returns:
true
if vertical positioning error is available- Since:
- 5.0
-
setVPE
public void setVPE(float vpe)
- Since:
- 5.0
-
getElevation
public double getElevation()
- Returns:
- Elevation above mean sea level (MSL) in meters
- Since:
- 5.11
-
hasElevation
public boolean hasElevation()
- Returns:
true
if elevation is available- Since:
- 5.11
-
setElevation
public void setElevation(double elevation)
- Since:
- 5.11
-
getAGL
public double getAGL()
- Returns:
- height above ground level in meters
- Since:
- 5.11
-
hasAGL
public boolean hasAGL()
- Returns:
true
if above ground level height is available- Since:
- 5.11
-
setAGL
public void setAGL(double agl)
- Since:
- 5.11
-
getAGLError
public double getAGLError()
- Returns:
- Calculated error estimate of the above ground level height value in meters
- Since:
- 5.11
-
getAGLError
public double getAGLError(int confidence)
- Parameters:
confidence
- desired confidence level for the error estimate: 68%, 90% or 95%- Returns:
- Calculated error estimate of the above ground level height value in meters
- Since:
- 5.11
-
hasAGLError
public boolean hasAGLError()
- Returns:
true
if AGL error is available- Since:
- 5.11
-
setAGLError
public void setAGLError(double aglError)
- Since:
- 5.11
-
getScore
public float getScore()
- Returns:
- location score -- a number between 0 (very low score, highly
suspect location) and 10 (very high score, highly trusted
location).
Note that this value is valid only when
hasScore()
returns true. - Since:
- 4.8
-
hasScore
public boolean hasScore()
- Returns:
true
if the score was calculated- Since:
- 4.8
-
setScore
public void setScore(float score)
- Since:
- 5.0
-
getNAP
public int getNAP()
- Returns:
- The number of access-point used to calculate this location.
-
hasNAP
public boolean hasNAP()
- Returns:
true
if number of access points used for location is available- Since:
- 5.0
-
setNAP
public void setNAP(int nap)
- Since:
- 5.0
-
getNSat
public int getNSat()
- Returns:
- The number of satellites used to calculate this location.
-
hasNSat
public boolean hasNSat()
- Returns:
true
if number of satellites used for location is available- Since:
- 5.0
-
setNSat
public void setNSat(int nsat)
- Since:
- 5.0
-
getNCell
public int getNCell()
- Returns:
- The number of cell towers used to calculate this location.
-
hasNCell
public boolean hasNCell()
- Returns:
true
if number of cell towers used for location is available- Since:
- 5.0
-
setNCell
public void setNCell(int ncell)
- Since:
- 5.0
-
getNLac
public int getNLac()
- Returns:
- The number of unique location area codes used to calculate this location.
-
hasNLac
public boolean hasNLac()
- Returns:
true
if number of unique location area codes used for location is available- Since:
- 5.0
-
setNLac
public void setNLac(int nlac)
- Since:
- 5.0
-
getHistoricalLocationCount
public int getHistoricalLocationCount()
- Returns:
- The number of previous locations used to corroborate this location.
- Since:
- 4.8
-
hasHistoricalLocationCount
public boolean hasHistoricalLocationCount()
- Since:
- 5.0
-
setHistoricalLocationCount
public void setHistoricalLocationCount(int nloc)
- Since:
- 5.0
-
withIP
public boolean withIP()
- Returns:
true
if the IP address of the client making the request was used to confirm the location, orfalse
otherwise- Since:
- 4.8
-
getServerTimestamp
public long getServerTimestamp()
- Returns:
- The timestamp (number of seconds since unix epoch) of this location
calculated using the time at Skyhook's server. This timestamp is
calculated on Skyhook's servers at the time the request is received,
and does not account for the network round-trip or the local time of
the device.
Note that this value is valid only when
hasServerTimeStamp()
returns true. - Since:
- 4.9.1
-
hasServerTimeStamp
public boolean hasServerTimeStamp()
- Returns:
true
if the server timestamp was calculated- Since:
- 4.9.1
-
getIp
public java.lang.String getIp()
- Returns:
- IP Address as received by Skyhook's servers or
null
otherwise. The presence of an IP address does not imply thatwithIP
is true. Note that this value is valid only whenhasScore()
returns true. - Since:
- 4.9.1
-
hasIp
public boolean hasIp()
- Returns:
true
if IP address is available- Since:
- 5.0
-
getSpeed
public double getSpeed()
- Returns:
- A calculated estimate of speed in meters per second.
Note that prior to 5.0 this value was in kilometers per second.
-
hasSpeed
public boolean hasSpeed()
- Returns:
true
if speed is available- Since:
- 5.0
-
setSpeed
public void setSpeed(double speed)
- Since:
- 5.0
-
getSpeedError
public double getSpeedError()
- Returns:
- A calculated error estimate of speed in meters per second.
- Since:
- 5.0
-
hasSpeedError
public boolean hasSpeedError()
- Returns:
true
if speed error is available- Since:
- 5.0
-
setSpeedError
public void setSpeedError(double speedError)
- Since:
- 5.0
-
getBearing
public double getBearing()
- Returns:
- A calculated estimate of bearing as degree from north clockwise (+90 is East).
-
hasBearing
public boolean hasBearing()
- Returns:
true
if bearing is available- Since:
- 5.0
-
setBearing
public void setBearing(double bearing)
- Since:
- 5.0
-
getBearingError
public double getBearingError()
- Returns:
- A calculated error estimate of bearing in degrees.
- Since:
- 5.0
-
hasBearingError
public boolean hasBearingError()
- Returns:
true
if bearing error is available- Since:
- 5.0
-
setBearingError
public void setBearingError(double bearingError)
- Since:
- 5.0
-
getStreetAddress
public StreetAddress getStreetAddress()
- Returns:
- The physical street address,
only returned when the
WPSStreetAddressLookup
parameter is set toWPS_LIMITED_STREET_ADDRESS_LOOKUP
orWPS_FULL_STREET_ADDRESS_LOOKUP
.
-
hasStreetAddress
public boolean hasStreetAddress()
- Returns:
true
if street address information is available- Since:
- 5.0
-
setStreetAddress
public void setStreetAddress(StreetAddress address)
-
hasVenue
public boolean hasVenue()
- Returns:
true
if venue information is available- Since:
- 5.13
-
getVenue
public Venue getVenue()
- Returns:
- Venue information
- Since:
- 5.13
-
setVenue
public void setVenue(Venue venue)
- Since:
- 5.13
-
getTimeZone
public TimeZone getTimeZone()
- Returns:
- time zone information,
only returned when the
timeZoneLookup
parameter is set totrue
. - Since:
- 5.0
-
hasTimeZone
public boolean hasTimeZone()
- Returns:
true
if time zone information is available- Since:
- 5.0
-
setTimeZone
public void setTimeZone(TimeZone timeZone)
- Since:
- 5.0
-
hasExtras
public boolean hasExtras()
- Returns:
true
if extra attributes are available- Since:
- 5.7
-
setExtras
public void setExtras(java.util.Map<java.lang.String,?> extras)
- Since:
- 5.7
-
getExtras
public java.util.Map<java.lang.String,?> getExtras()
- Returns:
- Extra attributes
- Since:
- 5.7
-
isNull
public boolean isNull()
-
clone
public WPSLocation clone()
-
-