Data types for location data.

## Cycling wheel revolution RPM

If a user goes cycling, this data type can be used to capture their **wheel
revolutions per minute (RPM)**. Each data point represents an instantaneous
measure of the wheel revolutions, so only the end time should be set. This will
be used as the timestamp for the reading.

> [!NOTE]
> **Note:** Different data sources need to monitor wheel revolutions for different amounts of time before calculating the instantaneous RPM. This should be indicated as part of the data source, not the data point.

### REST

|---|---|
| **Name** | `com.google.cycling.wheel_revolution.rpm` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.location.read https://www.googleapis.com/auth/fitness.location.write |
| **Fields (format---units)** | **rpm** (`float`---rpm) Number of bicycle wheel revolutions per minute. |

### Android

|---|---|
| **Name** | `com.google.cycling.wheel_revolution.rpm` |
| **Data type object** | `TYPE_CYCLING_WHEEL_RPM` |
| **Fields (format---units)** | **FIELD_RPM** (`float`---rpm) Number of bicycle wheel revolutions per minute. |

## Cycling wheel revolution cumulative

If a user goes cycling, this data type can be used to capture the number of
**wheel revolutions over a time period**. Each data point represents the number
of revolutions since the count at the start time.

> [!NOTE]
> **Note:** Each data point captures the total number of revolutions since the start time. It's not the delta or change in revolutions. So the number of revolutions over a time interval can be calculated by subtracting the final count at the end time from the initial count at the start time.

### REST

|---|---|
| **Name** | `com.google.cycling.wheel_revolution.cumulative` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.location.read https://www.googleapis.com/auth/fitness.location.write |
| **Fields (format---units)** | **revolutions** (`int`---count) Number of bicycle wheel revolutions. |

### Android

|---|---|
| **Name** | `com.google.cycling.wheel_revolution.cumulative` |
| **Data type object** | `TYPE_CYCLING_PEDALING_CUMULATIVE` |
| **Fields (format---units)** | **FIELD_REVOLUTIONS** (`int`---count) Number of bicycle wheel revolutions. |

## Distance delta

This data type captures distance travelled by the user since the last reading,
in meters. The total distance over an interval can be calculated by adding
together all the values during the interval. The start time of each data point
should represent the start of the interval in which the distance was covered.
The start time must be equal to or greater than the end time of the previous
data point.

### REST

|---|---|
| **Name** | `com.google.distance.delta` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.location.read https://www.googleapis.com/auth/fitness.location.write |
| **Fields (format---units)** | **distance** (`float`---meters) Distance travelled in meters. **Valid range**: 0---100 meters per second |

### Android

|---|---|
| **Name** | `com.google.distance.delta` |
| **Data type object** | `TYPE_DISTANCE_DELTA` |
| **Android permissions** | `ACCESS_FINE_LOCATION` and `ACTIVITY_RECOGNITION` |
| **Fields (format---units)** | **FIELD_DISTANCE** (`float`---meters) Distance travelled in meters. **Valid range**: 0---100 meters per second |

## Location sample

This data type captures the user's location. Because each data point
represents the location of the user at the time of the reading, only the end time
should be set. This will be used as the timestamp for the reading.

> [!NOTE]
> **Note:** This data can only be read by the app that wrote the data. Your app can only read back data it wrote. It cannot read location sample data written by other apps.

### REST

|---|---|
| **Name** | `com.google.location.sample` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.location.read https://www.googleapis.com/auth/fitness.location.write |
| **Fields (format---units)** | |---| | **latitude** (`float`---degrees) The latitude of a location in degrees. **Valid range**: -90 to 90 degrees | | **longitude** (`float`---degrees) The longitude of a location in degrees. **Valid range**: -180 to 180 degrees | | **accuracy** (`float`---meters) The estimated 'radius of accuracy' the location would be within, in meters. For example, if you drew a circle around this location with a radius equal to the accuracy, there should be a 68% chance that the user's true location is within the circle. This estimate is for horizontal accuracy only. It doesn't indicate the accuracy of bearing, velocity or altitude (if those are included for this Location). If this location doesn't have a horizontal accuracy, then 0.0 is returned. **Valid range**: 0---10,000 meters | | **altitude** (`float`---meters) The height of the location from sea level, in meters. **Valid range**: -100,000---100,000 meters | |
| **Fields (format---units)** |
| **Fields (format---units)** |
| **Fields (format---units)** |

### Android

|---|---|
| **Name** | `com.google.location.sample` |
| **Data type object** | `TYPE_LOCATION_SAMPLE` |
| **Android permission** | `ACCESS_FINE_LOCATION` |
| **Fields (format---units)** | |---| | **FIELD_LATITUDE** (`float`---degrees) The latitude of a location in degrees. **Valid range**: -90 to 90 degrees | | **FIELD_LONGITUDE** (`float`---degrees) The longitude of a location in degrees. **Valid range**: -180 to 180 degrees | | **FIELD_ACCURACY** (`float`---meters) The estimated 'radius of accuracy' the location would be within, in meters. For example, if you drew a circle around this location with a radius equal to the accuracy, there should be a 68% chance that the user's true location is within the circle. This estimate is for horizontal accuracy only. It doesn't indicate the accuracy of bearing, velocity or altitude (if those are included for this Location). If this location doesn't have a horizontal accuracy, then 0.0 is returned. **Valid range**: 0---10,000 meters | | **FIELD_ALTITUDE** (`float`---meters) The height of the location from sea level, in meters. **Valid range**: -100,000---100,000 meters | |
| **Fields (format---units)** |
| **Fields (format---units)** |
| **Fields (format---units)** |

## Speed

This data type captures the user's speed in meters per second. The
value represents the scalar magnitude of the speed, so negative values should
not occur. Because each data point represents the speed at the time of the
reading, only the end time should be set. This will be used as the timestamp for
the reading.

### REST

|---|---|
| **Name** | `com.google.speed` |
| **OAuth permission scopes** | https://www.googleapis.com/auth/fitness.location.read https://www.googleapis.com/auth/fitness.location.write |
| **Fields (format---units)** | **speed** (`float`---meters per second) Travelling speed. **Valid range**: 0---11,000 meters per second |

### Android

|---|---|
| **Name** | `com.google.speed` |
| **Data type object** | `TYPE_SPEED` |
| **Android permission** | `ACCESS_FINE_LOCATION` |
| **Fields (format---units)** | **speed** (`float`---meters per second) Travelling speed. **Valid range**: 0---11,000 meters per second |