Location (API Reference)
Class Location
Describes a location in the world at a given time.
-
Field Summary
FieldsModifier and TypeFieldDescriptionEstimated bearing accuracy for this location, in degrees.Bearing (also known as course) is the device's horizontal direction of travel.The geographic coordinates of the location.Optional gnss time at which the location was determined.The estimated horizontal accuracy.Optional technology or provider of this location.Pitch of this location, in degrees.Optional source of this location.Estimated speed accuracy of this location, in meters per second.Current speed of the device.The time at which the location was determined.The time at which the location was determined, relative to device boot time.Estimated vertical accuracy. -
Constructor Summary
ConstructorsConstructorDescriptionLocation(GeoCoordinates coordinates) Creates a new Location instance from the provided GeoCoordinates value. -
Method Summary
-
Field Details
-
coordinates
The geographic coordinates of the location.
-
bearingInDegrees
Bearing (also known as course) is the device's horizontal direction of travel. Starts at 0 in the geographical north and rotates around the compass in a clockwise direction. This means for going north it is equal to 0, for northeast it is 45, for east it is 90 and so on. Note that this may be different from the orientation of the device. If it cannot be determined, the value is
null. Otherwise, it is guaranteed to be in the range [0, 360). -
speedInMetersPerSecond
Current speed of the device. If it cannot be determined, the value is
null. -
time
The time at which the location was determined.
-
horizontalAccuracyInMeters
The estimated horizontal accuracy. The actual location will lie within this radius of uncertainty.
-
verticalAccuracyInMeters
Estimated vertical accuracy. Given that the received Location contains the altitude, the real value of the altitude is estimated to lie within the following range: [altitude - vertical accuracy, altitude + vertical accuracy]. For example, when the altitude is equal to 50 and the vertical accuracy is 8, then the actual value is most likely in the range [42, 58].
-
bearingAccuracyInDegrees
Estimated bearing accuracy for this location, in degrees. If it cannot be determined, the value is
null. -
speedAccuracyInMetersPerSecond
Estimated speed accuracy of this location, in meters per second. If it cannot be determined, the value is
null. -
timestampSinceBoot
The time at which the location was determined, relative to device boot time. This time is monotonic and not affected by leap time or other system time adjustments, so this is the recommended basis for general purpose interval timing between location updates. If it cannot be determined, the value is
null. -
locationTechnology
Optional technology or provider of this location. If it cannot be determined, the value is
null. -
source
Optional source of this location. If it cannot be determined, the value is
null. -
gnssTime
Optional gnss time at which the location was determined. It is a time interval from the Unix time epoch in milliseconds. If it cannot be determined, the value is
null. -
pitchInDegrees
Pitch of this location, in degrees. If it cannot be determined, the value is
null.
-
-
Constructor Details
-
Location
Creates a new Location instance from the provided GeoCoordinates value. timestamp is initialized with
January 1, 1970, 00:00:00 GMTvalue. The rest of the fields will be initialized to null.- Parameters:
coordinates-The geographic coordinates of the location.
-
-
Method Details