Once you have configured your app's settings to use the Geospatial API, you can call [`Earth.getCameraGeospatialPose()`](https://developers.google.com/ar/reference/java/com/google/ar/core/Earth#getCameraGeospatialPose-) to obtain a [`GeospatialPose`](https://developers.google.com/ar/reference/java/com/google/ar/core/GeospatialPose) that describes the device's Geospatial positioning for the camera in the latest frame. This pose, managed in an [`Earth`](https://developers.google.com/ar/reference/java/com/google/ar/core/Earth) object, contains the following information:

- Location, expressed in latitude and longitude
- Altitude
- An orientation approximating the direction the user is facing in the EUS coordinate system with X+ pointing east, Y+ pointing up, and Z+ pointing south

## Check the tracking state

Geospatial values are only valid while [`Earth.TrackingState`](https://developers.google.com/ar/reference/java/com/google/ar/core/TrackingState) is [`TrackingState.TRACKING`](https://developers.google.com/ar/reference/java/com/google/ar/core/TrackingState#tracking). Make sure to wrap all Geospatial API calls in a [`Earth.TrackingState`](https://developers.google.com/ar/reference/java/com/google/ar/core/TrackingState) control block.

### Java

```java
if (earth != null && earth.getTrackingState() == TrackingState.TRACKING) {
  GeospatialPose cameraGeospatialPose = earth.getCameraGeospatialPose();
  // cameraGeospatialPose contains geodetic location, rotation, and confidences values.
}
```

### Kotlin

```kotlin
if (earth.trackingState == TrackingState.TRACKING) {
  val cameraGeospatialPose = earth.cameraGeospatialPose
  // cameraGeospatialPose contains geodetic location, rotation, and confidences values.
}
```

If [`Earth.TrackingState`](https://developers.google.com/ar/reference/java/com/google/ar/core/TrackingState) does not become [`TrackingState.TRACKING`](https://developers.google.com/ar/reference/java/com/google/ar/core/TrackingState#tracking), [`Earth.TrackingState`](https://developers.google.com/ar/reference/java/com/google/ar/core/TrackingState) may be [`TrackingState.PAUSED`](https://developers.google.com/ar/reference/java/com/google/ar/core/TrackingState#paused) or [`TrackingState.STOPPED`](https://developers.google.com/ar/reference/java/com/google/ar/core/TrackingState#stopped). If neither of these conditions are true, check [`Earth.Earthstate`](https://developers.google.com/ar/reference/java/com/google/ar/core/Earth.EarthState), which shows other error states that may keep the [`Earth`](https://developers.google.com/ar/reference/java/com/google/ar/core/Earth) object from tracking.

## Adjust the pose for accuracy

When the device is upright in the default orientation, the pitch (X+) and roll (Z+) angles tend to be precise due to a natural alignment with AR tracking. However, the yaw (Y+) angles can vary depending on VPS data availability and temporal conditions at the location. Your app may have to make adjustments for accuracy.

[`GeospatialPose.getOrientationYawAccuracy()`](https://developers.google.com/ar/reference/java/com/google/ar/core/GeospatialPose#getOrientationYawAccuracy-) provides an accuracy estimate for the yaw (Y+) angles for a certain [`GeospatialPose`](https://developers.google.com/ar/reference/java/com/google/ar/core/GeospatialPose). The orientation yaw accuracy is a number that describes the radius, in degrees, of the 68th percentile confidence level around the yaw angles returned from [`GeospatialPose.getEastUpSouthQuaternion()`](https://developers.google.com/ar/reference/java/com/google/ar/core/GeospatialPose#getEastUpSouthQuaternion-). In other words, there is a 68% chance that the [`GeospatialPose`](https://developers.google.com/ar/reference/java/com/google/ar/core/GeospatialPose)'s true yaw angle is accurate.

Larger values indicate lower accuracy. For example, if the estimated yaw angle is 60 degrees and the yaw accuracy is 10 degrees, then there is a 68% probability that the true yaw angle is between 50 and 70 degrees.

## What's next

- Place a [Geospatial anchor](https://developers.google.com/ar/develop/java/geospatial/anchors#wgs84_anchors) by obtaining the anchor's Geospatial pose.