GeoLocation

class GeoLocation(val position: GeoPoint, val accuracy: Distance? = null, val course: Angle? = null, val speed: Speed? = null, val altitude: Distance? = null, val time: Long = System.currentTimeMillis(), val elapsedRealtimeNanos: Long = SystemClock.elapsedRealtimeNanos(), val provider: String = DEFAULT_PROVIDER, val providerType: LocationProviderType = LocationProviderType.REALTIME, val extras: Bundle? = null)

Geographical representation of a certain location. It provides additional attributes like speed or bearing what can be useful in navigation applications.

Parameters

position

Geographical position of the current location.

accuracy

GPS accuracy of the current location.

course

Course The direction of travel, expressed in degrees clockwise from the north in the range [0,360.0]. Or null if not available. Note: In the Android Location API, the corresponding field is called android.location.Location#getBearing.

speed

Current speed or null if not available.

altitude

Altitude or null if not available.

time

The UTC time of this location fix, in milliseconds since epoch (January 1, 1970).

It is not monotonic, so it should not be used to compare instances of GeoLocation. Prefer elapsedRealtimeNanos for that purpose.

elapsedRealtimeNanos

The monotonic time of this fix since system boot, including time spent in deep sleep, in nanoseconds.

Unlike time, this property can be used to reliably compare instances of GeoLocation because it is guaranteed to be monotonic.

provider

The name of the location provider.

providerType

The type of the location provider (e.g., REALTIME or SOFT_DR).

extras

Extra data accompanying this location.

Constructors

Link copied to clipboard
constructor(position: GeoPoint, accuracy: Distance? = null, course: Angle? = null, speed: Speed? = null, altitude: Distance? = null, time: Long = System.currentTimeMillis(), elapsedRealtimeNanos: Long = SystemClock.elapsedRealtimeNanos(), provider: String = DEFAULT_PROVIDER, providerType: LocationProviderType = LocationProviderType.REALTIME, extras: Bundle? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val accuracy: Distance? = null
Link copied to clipboard
val altitude: Distance? = null
Link copied to clipboard
val course: Angle? = null
Link copied to clipboard
Link copied to clipboard
val extras: Bundle? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val speed: Speed? = null
Link copied to clipboard
val time: Long

Functions

Link copied to clipboard
operator fun component1(): GeoPoint
Link copied to clipboard
operator fun component10(): Bundle?
Link copied to clipboard
operator fun component2(): Distance?
Link copied to clipboard
operator fun component3(): Angle?
Link copied to clipboard
operator fun component4(): Speed?
Link copied to clipboard
operator fun component5(): Distance?
Link copied to clipboard
operator fun component6(): Long
Link copied to clipboard
operator fun component7(): Long
Link copied to clipboard
operator fun component8(): String
Link copied to clipboard
Link copied to clipboard
fun copy(position: GeoPoint = this.position, accuracy: Distance? = this.accuracy, course: Angle? = this.course, speed: Speed? = this.speed, altitude: Distance? = this.altitude, time: Long = this.time, elapsedRealtimeNanos: Long = this.elapsedRealtimeNanos, provider: String = this.provider, providerType: LocationProviderType = this.providerType, extras: Bundle? = this.extras): GeoLocation
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String