-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classLocation.ValueContainerpublic final classLocation.ValueContainerShortpublic final classLocation.ValueContainerIntpublic classLocation.ValueContainerFloatpublic final classLocation.ValueContainerDoublepublic classLocation.Companion
-
Field Summary
-
Method Summary
Modifier and Type Method Description final LonggetId()Location unique ID. final UnitsetId(Long id)Location unique ID. final StringgetProvider()Provider for location source. final UnitsetProvider(String provider)Provider for location source. final LonggetTime()UTC time of this location (in ms). final UnitsetTime(Long time)UTC time of this location (in ms). final DoublegetLatitude()Latitude of location in WGS coordinates. final UnitsetLatitude(Double latitude)final DoublegetLongitude()Longitude of location in WGS coordinates. final UnitsetLongitude(Double longitude)final Location.ValueContainerDoublegetAltitude()Altitude value of the location (in m). final Location.ValueContainerFloatgetSpeed()Speed of the device in meters/second. final Location.ValueContainerFloatgetBearing()Direction of travel in degrees East of true North. final Location.ValueContainerFloatgetAccuracyHor()Horizontal accuracy of the fix. final Location.ValueContainerFloatgetAccuracyVer()Vertical accuracy of the fix. final Location.ValueContainerShortgetSensorCadence()Cadence value. final Location.ValueContainerShortgetSensorHeartRate()Heart rate value in BMP. final Location.ValueContainerFloatgetSensorSpeed()Speed of the device over ground in meters/second. final Location.ValueContainerFloatgetSensorPower()Power value of the fix in W. final Location.ValueContainerIntgetSensorStrides()The num of strides. final Location.ValueContainerFloatgetSensorTemperature()Temperature value. final Location.ValueContainerShortgetGnssQuality()final Location.ValueContainerFloatgetGnssHdop()final Location.ValueContainerFloatgetGnssVdop()final Location.ValueContainerFloatgetGnssPdop()final Location.ValueContainerShortgetGnssSatsUsed()final Location.ValueContainerShortgetGnssSatsVisible()final FloatgetSpeedOptimal()final StorablegetCopy()final ByteArraygetAsBytes()final BooleanhasAnySensorData()Check if object has any recorded sensor data. final Unitset(Location loc)Sets the contents of the location to the values from the given location. final BooleanhasSpeedOptimal()Check if any speed (GPS or from sensors) is stored. final UnitremoveSensorAll()Remove all attached sensors values. final UnitremoveGnssAll()Remove all values related to GNSS metadata. StringtoString()final FloatdistanceTo(Location dest)Returns the approximate distance in meters between this location and the given location. final FloatbearingTo(Location dest)Returns the approximate initial bearing in degrees East of true North when traveling along the shortest path between this location and the given location. final FloatArraydistanceAndBearingTo(Location dest)Compute bearing and distance values at once -
-
Method Detail
-
getProvider
final String getProvider()
Provider for location source.
-
setProvider
final Unit setProvider(String provider)
Provider for location source.
-
getLatitude
final Double getLatitude()
Latitude of location in WGS coordinates.
-
setLatitude
final Unit setLatitude(Double latitude)
-
getLongitude
final Double getLongitude()
Longitude of location in WGS coordinates.
-
setLongitude
final Unit setLongitude(Double longitude)
-
getAltitude
final Location.ValueContainerDouble getAltitude()
Altitude value of the location (in m). If 'hasData' is false, 0.0f is returned.
-
getSpeed
final Location.ValueContainerFloat getSpeed()
Speed of the device in meters/second.
-
getBearing
final Location.ValueContainerFloat getBearing()
Direction of travel in degrees East of true North. If 'hasData' is false, 0.0 is returned (in degree).
-
getAccuracyHor
final Location.ValueContainerFloat getAccuracyHor()
Horizontal accuracy of the fix. If 'hasData' is false, 0.0 is returned (in m).
-
getAccuracyVer
final Location.ValueContainerFloat getAccuracyVer()
Vertical accuracy of the fix. If 'hasData' is false, 0.0 is returned (in m).
-
getSensorCadence
final Location.ValueContainerShort getSensorCadence()
Cadence value. If hasCadence() is false, 0 is returned.
-
getSensorHeartRate
final Location.ValueContainerShort getSensorHeartRate()
Heart rate value in BMP. If hasSensorHeartRate() is false, 0 is returned.
-
getSensorSpeed
final Location.ValueContainerFloat getSensorSpeed()
Speed of the device over ground in meters/second. This speed is defined only when 'speed sensor' is connected and supply valid values.
If 'hasData' is 'false', 0.0f is returned (in m/s).
-
getSensorPower
final Location.ValueContainerFloat getSensorPower()
Power value of the fix in W. If hasSensorPower() is false, 0.0 is returned.
-
getSensorStrides
final Location.ValueContainerInt getSensorStrides()
The num of strides. If hasSensorStrides() is false, 0 is returned.
-
getSensorTemperature
final Location.ValueContainerFloat getSensorTemperature()
Temperature value. If hasSensorTemperature() is false, 0.0f is returned.
-
getGnssQuality
final Location.ValueContainerShort getGnssQuality()
-
getGnssHdop
final Location.ValueContainerFloat getGnssHdop()
-
getGnssVdop
final Location.ValueContainerFloat getGnssVdop()
-
getGnssPdop
final Location.ValueContainerFloat getGnssPdop()
-
getGnssSatsUsed
final Location.ValueContainerShort getGnssSatsUsed()
-
getGnssSatsVisible
final Location.ValueContainerShort getGnssSatsVisible()
-
getSpeedOptimal
final Float getSpeedOptimal()
-
getAsBytes
final ByteArray getAsBytes()
-
hasAnySensorData
final Boolean hasAnySensorData()
Check if object has any recorded sensor data.
This method by-pass initializing of inner objects so it is a good practice to check this value before dealing with any sensor data.
-
set
final Unit set(Location loc)
Sets the contents of the location to the values from the given location.
-
hasSpeedOptimal
@Deprecated(message = Work with speed value directly) final Boolean hasSpeedOptimal()
Check if any speed (GPS or from sensors) is stored.
-
removeSensorAll
final Unit removeSensorAll()
Remove all attached sensors values.
-
removeGnssAll
final Unit removeGnssAll()
Remove all values related to GNSS metadata.
-
distanceTo
final Float distanceTo(Location dest)
Returns the approximate distance in meters between this location and the given location. Distance is defined using the WGS84 ellipsoid.
- Parameters:
dest- the destination location
-
bearingTo
final Float bearingTo(Location dest)
Returns the approximate initial bearing in degrees East of true North when traveling along the shortest path between this location and the given location. The shortest path is defined using the WGS84 ellipsoid. Locations that are (nearly) antipodal may produce meaningless results.
- Parameters:
dest- the destination location
-
distanceAndBearingTo
final FloatArray distanceAndBearingTo(Location dest)
Compute bearing and distance values at once
- Parameters:
dest- the destination location
-
-
-
-