# TripLocation

Represents the user's location during an ongoing Trip. See [startReceivingTripLocationUpdates(int, TripLocationUpdatesListener)](https://docs.sentiance.com/important-topics/sdk/api-reference/android/eventtimelineapi#startreceivingtriplocationupdates).

## TripLocation API

### `getAccuracy()`

Returns the location's accuracy in meters.

If this location does not have an accuracy, then `null` is returned.

```java
@Nullable Float getAccuracy();
```

### `getAltitude()`

Returns the altitude of this location in meters above the WGS84 reference ellipsoid.

If this location does not have an altitude available, then `null` is returned.

```java
@Nullable Double getAltitude();
```

### `getBearing()`

Returns the bearing at the time of this location in degrees.

Bearing is the horizontal direction of travel of this device and is unrelated to the device orientation. The bearing is guaranteed to be in the range \[0, 360).

If this location does not have a bearing, then `null` is returned.

```java
@Nullable Float getBearing();
```

### `getBearingAccuracy()`

Returns the estimated bearing accuracy in degrees of this location at the 68th percentile confidence level. This means that there is 68% chance that the true bearing at the time of this location falls within the reported bearing, +/- this uncertainty.

If this location does not have a bearing accuracy, then `null` is returned.

```java
@Nullable Float getBearingAccuracy();
```

### `getLatitude()`

Returns the latitude in degrees.

```java
double getLatitude();
```

### `getLongitude()`

Returns the longitude in degrees.

```java
double getLongitude();
```

### `getSpeed()`

Returns the speed at the time of this location, in meters per second.

If this location does not have a speed, then `null` is returned.

```java
@Nullable Float getSpeed();
```

### `getSpeedAccuracy()`

Returns the estimated speed accuracy in meters per second of this location at the 68th percentile confidence level. This means that there is 68% chance that the true speed at the time of this location falls within the reported speed, +/- this uncertainty.

If this location does not have a speed accuracy, then `null` is returned.

```java
@Nullable Float getSpeedAccuracy();
```

### `getTimestamp()`

Returns the UTC time of this trip location, in milliseconds since epoch (January 1, 1970).

```java
long getTimestamp();
```

### `getTransportMode()`

Returns the most probable transport mode at the time of this location. See [TransportMode](https://docs.sentiance.com/important-topics/sdk/api-reference/android/eventtimeline/transportmode).

```java
TransportMode getTransportMode();
```

### `getVerticalAccuracy()`

Returns the estimated altitude accuracy in meters of this location at the 68th percentile confidence level. This means that there is 68% chance that the true altitude of this location falls within the reported altitude, +/- this uncertainty.

If this location does not have a vertical accuracy, then `null` is returned.

```java
@Nullable Float getVerticalAccuracy();
```
