> For the complete documentation index, see [llms.txt](https://docs.multiset.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.multiset.ai/fundamentals/localization/geopose-support.md).

# GeoPose Support

The GeoPose object in the localization response, how it relates to local map coordinates, and when to use each.

At MultiSet, our goal is to provide the most accurate and flexible localization possible. To enhance the portability and interoperability of our localization data, the MultiSet API response now includes a [**GeoPose**](https://www.geopose.org/) object.

This document explains what GeoPose is, how it's structured in our API response, and how you can use it to build powerful, large-scale, and interconnected applications.

## What is GeoPose?

[**GeoPose**](https://www.geopose.org/) is an open standard for expressing the position and orientation (a full 6-DoF pose) of an object in a real-world, geographic coordinate system (WGS-84).

Think of it as a universal language for location. Instead of describing a position relative to a local, arbitrary map origin (e.g., "5 meters from the corner of a building"), GeoPose describes the exact same position and orientation in a globally consistent frame of reference that any GIS, mapping, or geospatial tool can understand.

This solves a major challenge in AR and robotics: **data interoperability**.

#### The MultiSet Localization Response

When you perform a localization query, our API returns a JSON object containing two distinct but related coordinate systems: the traditional **Local Map Coordinates** and the new **Global GeoPose Coordinates**.

{% hint style="success" %}
To enable GeoPose in the localization response, pass `convertToGeoCoordinates: true` in the body of the localization query.
{% endhint %}

### **Sample API Response:**

```json
{
    "poseFound": true,
    "position": {
        "x": -0.1236,
        "y": 1.5630,
        "z": 6.9945
    },
    "rotation": {
        "x": 0.0054,
        "y": -0.5753,
        "z": -0.0092,
        "w": 0.8178
    },
    "mapIds": [
        "68c8fe2ff8f229955c39eb02"
    ],
    "GeoPose": {
        "frame_spec": {
            "model": "WGS-84",
            "frame": "Y-Up-ENU"
        },
        "pose": {
            "position": {
                "lat": 12.952603,
                "lon": 77.616157,
                "h": 912.9230
            },
            "quaternion": {
                "x": -0.0027,
                "y": 0.1715,
                "z": -0.0104,
                "w": 0.9851
            }
        }
    },
    "mapHeadingDeg": 90
}
```

#### Understanding the Two Coordinate Systems

### **1. Local Map Coordinates (position, rotation)**

The top-level position and rotation fields provide the device's pose relative to the internal origin of the specific MultiSet map (mapIds).

* **position**: {x, y, z} in meters from the map's origin.
* **rotation**: {x, y, z, w} quaternion describing the device's orientation in the map's local frame.

**When to use it:** This is the most direct and performant data to use for rendering content **within the context of that specific MultiSet map**. If your application's logic and assets all exist relative to the map you just localized against, this is the pose to use.

### **2. Global Coordinates (GeoPose)**

The nested GeoPose object provides the same pose but in a globally consistent reference frame.

* **frame\_spec**: Defines the coordinate system.
  * model: WGS-84, the standard GPS ellipsoid model.
  * frame: the local frame the quaternion is expressed in. The default is `Y-Up-ENU`, where +X is East, +Y is Up and +Z is True North. See [Choosing the frame](#choosing-the-frame).
* **pose.position**:
  * lat: Latitude in decimal degrees.
  * lon: Longitude in decimal degrees.
  * h: Ellipsoidal height in meters.
* **pose.quaternion**: The device's orientation in that frame, at its specific location.

Next to `GeoPose`, the response carries **mapHeadingDeg**: the direction of the map's +Z axis, in degrees clockwise from true north.

**When to use it:** You should use the GeoPose object whenever you need to interact with external systems or data that is not tied to the specific MultiSet map.

### Choosing the frame

The optional `geoPoseFrame` field of the localization query selects the frame of `pose.quaternion`. Position is the same in both.

| `geoPoseFrame`       | Axes                                                 | Camera axes                                                                                                                    |
| -------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `Y-Up-ENU` (default) | Left-handed: +X East, +Y Up, +Z North                | +X right, +Y up, +Z forward, as in Unity                                                                                       |
| `ENU`                | Right-handed: +X East, +Y North, +Z Up (OGC GeoPose) | With `isRightHanded: true`: +X right, +Y up, -Z forward, as in ARKit, ARCore and WebXR. Otherwise: +X right, +Y forward, +Z up |

Every query gets `Y-Up-ENU` unless it asks for `ENU`, whatever its `isRightHanded` value. `frame_spec.frame` in the response names the frame that was used.

### Reading the orientation

**Compass heading.** Rotate the camera's forward axis (0, 0, 1) by the `Y-Up-ENU` quaternion. The result is a direction with East, Up and North components, so the heading in degrees clockwise from true north is `atan2(x, z)`.

**Unity.** `Y-Up-ENU` matches Unity's left-handed, Y-up world, so the quaternion can be used as a Unity rotation directly.

{% hint style="info" %}
**iOS SDK 2.4.0 and later** does this for you. `MultiSet.shared.geoAlignment` converts between latitude, longitude and the AR session, and `MultiSet.shared.deviceGeolocation()` returns the device's compass heading on any frame. See the iOS [Polling API](https://docs.multiset.ai/native-sdk/ios-swift-native/api-reference/polling-api.md). The example below is for earlier SDK versions and other clients.
{% endhint %}

**ARKit and other right-handed clients.** `Y-Up-ENU` is left-handed, so convert the quaternion before combining it with a right-handed camera rotation. This Swift example returns the rotation from the ARKit session to East-North-Up, using the `queryCameraRotation` the iOS SDK reports with each result:

```swift
import simd

/// Rotation from the ARKit session frame to East-North-Up (x = East, y = North, z = Up).
func arSessionToENU(_ q: GeoPose.Quaternion, queryCameraRotation: simd_quatf) -> simd_quatf {
    let s = Float(0.5).squareRoot()
    // The same camera orientation in the right-handed ENU frame, with ARKit camera axes
    let cameraInENU = simd_quatf(ix: s * (q.w - q.x),
                                 iy: -s * (q.y + q.z),
                                 iz: s * (q.z - q.y),
                                 r: s * (q.w + q.x))
    return cameraInENU * queryCameraRotation.inverse
}

func onLocalizationSuccess(result: LocalizationResult) {
    guard let q = result.geoPose?.quaternion,
          let cameraRotation = result.queryCameraRotation else { return }

    let arToENU = arSessionToENU(q, queryCameraRotation: cameraRotation)

    // Direction of the session's -Z axis, in degrees clockwise from true north
    let north = arToENU.act(SIMD3<Float>(0, 0, -1))
    let sessionHeading = atan2(north.x, north.y) * 180 / .pi
}
```

REST callers that send `isRightHanded: true` can skip the conversion by passing `geoPoseFrame: "ENU"`. The returned quaternion is then `cameraInENU` itself.

#### Why This Matters: Use Cases for GeoPose

Providing both poses gives you maximum flexibility. The GeoPose object unlocks powerful new capabilities for interoperability:

1. **Building Digital Twins:**\
   Fuse MultiSet's real-time localization with building information models (BIM), GIS data, or sensor feeds. Since GeoPose is a global standard, you can align data from multiple sources with high precision.
2. **Large-Scale, Multi-Map Experiences:**\
   Create seamless AR experiences that span multiple, non-overlapping MultiSet maps. You can use the GeoPose to calculate the transformations between different maps and manage user location in a global context.
3. **Data Portability and Logging:**\
   Log user or device trajectories in a format that is independent of any single map. This data can be analyzed later in standard geospatial tools or used to visualize paths on a 2D map like Mapbox or Google Maps.
4. **Inter-System Communication:**\
   Pass the location of a device localized by MultiSet to another system that uses GPS or a different localization technology. For example, guide an autonomous robot localized with MultiSet to a specific GPS coordinate.

#### Practical Example

Imagine your application needs to show a 3D model of a proposed building (from a CAD file with georeferenced coordinates) within your AR scene.

1. Your app receives the localization response from the MultiSet API.
2. You use the GeoPose object to understand the device's absolute position and orientation on Earth.
3. Your app knows the absolute GeoPose of the proposed building.
4. You can now calculate the building's position and orientation relative to your device and render it correctly in your scene, even if your local scene's origin is completely different from the MultiSet map's origin.

The GeoPose acts as the "ground truth" that connects your MultiSet-powered world to any other georeferenced data source.

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.multiset.ai/fundamentals/localization/geopose-support.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
