Obtain the device camera's Geospatial transform

Stay organized with collections Save and categorize content based on your preferences.

Once you have configured your app's settings to use the Geospatial API, you can obtain the device camera's GARGeospatialTransform. This pose, managed in an GAREarth object, contains the following information:

  • Location, expressed in latitude and longitude. An estimate of the location accuracy is also supplied.
  • Altitude, and an estimate of the altitude's accuracy.
  • Heading, an approximation of the direction the device is facing, and an estimate of the accuracy of the heading.

Geospatial values are only valid while the session is tracking and receiving frames that allow access to the camera image and device transform.

GARGeospatialTransform *geospatialTransform = garFrame.earth.cameraGeospatialTransform;

Adjust for transform accuracy

As noted in the quickstart, the accuracy of the transform from the VPS may vary, due to the availability of VPS data for the location, or due to temporal conditions at the location. Your app may have to make adjustments for the accuracy of the transform, as determined by the Geospatial API.

The GARGeospatialTransform provides estimates for the accuracy of the latitude/longitude, altitude, and heading values.

For example, if the heading value returned from GARGeospatialTransform.heading is 60 degrees, and the value from GARGeospatialTransform.headingAccuracy is 10, there is a 68% probability that the VPS heading is within 10 degrees of the observed heading, as illustrated in the diagram on the left.

Heading accuracy

If the value from GARGeospatialTransform.headingAccuracy is 15, there is a 68% chance that the true heading is within 15 degrees of 60 degrees, as shown in the diagram on the right. Note that the higher the value returned from GARGeospatialTransform.headingAccuracy, the lower the accuracy of the heading value from GARGeospatialTransform.heading.

Similarly, GARGeospatialTransform.horizontalAccuracy reports the number of meters within which the true latitude/longitude value has a 68% probability of being within the given distance, and GARGeospatialTransform.verticalAccuracy reports the number of meters within which the true altitude value has a 68% probability of being within the given distance.

What's next