> For the complete documentation index, see [llms.txt](https://multiset.gitbook.io/multiset/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://multiset.gitbook.io/multiset/native-sdk/ios-swift-native/api-reference/localizationresult.md).

# LocalizationResult

## Overview

`LocalizationResult` is delivered to [`onLocalizationSuccess(result:)`](/multiset/native-sdk/ios-swift-native/api-reference/multisetcallback.md) when a pose is returned and accepted. It carries the computed pose that the SDK applied, the raw server values behind it, and optional geographic data.

***

## Properties

| Property              | Type               | Description                                                                             |
| --------------------- | ------------------ | --------------------------------------------------------------------------------------- |
| `mapCode`             | `String`           | The map code where localization succeeded                                               |
| `mapCodes`            | `[String]`         | All map codes returned, which may be several for a MapSet                               |
| `position`            | `SIMD3<Float>`     | Computed position in AR world coordinates                                               |
| `rotation`            | `simd_quatf`       | Computed rotation in AR world coordinates                                               |
| `confidence`          | `Float?`           | Confidence score of the localization (0.0 to 1.0)                                       |
| `geoCoordinates`      | `GeoCoordinates?`  | Geographic position, when `geoCoordinatesInResponse` is enabled                         |
| `geoPose`             | `GeoPose?`         | Full geographic pose, including orientation, when `geoCoordinatesInResponse` is enabled |
| `estimatedPosition`   | `SIMD3<Float>?`    | Raw camera position the server returned, in the map frame                               |
| `estimatedRotation`   | `simd_quatf?`      | Raw camera rotation the server returned, in the map frame                               |
| `queryCameraPosition` | `SIMD3<Float>?`    | AR camera position that produced this fix, in the AR session frame                      |
| `queryCameraRotation` | `simd_quatf?`      | AR camera rotation that produced this fix, in the AR session frame                      |
| `timestamp`           | `Date`             | When the result was produced                                                            |
| `mode`                | `LocalizationMode` | The localization mode used                                                              |

### Computed pose versus raw pose

`position` and `rotation` are the **computed** pose: the transform between the AR session frame and the map frame, which is what the SDK applies to the scene. This is the pair almost every app wants.

`estimatedPosition` / `estimatedRotation` and `queryCameraPosition` / `queryCameraRotation` are the untransformed inputs the computed pose was derived from. They are exposed for diagnostics, for logging a fix faithfully, and for apps that need to recompute the transform themselves.

```swift
func onLocalizationSuccess(result: LocalizationResult) {
    print("Localized in \(result.mapCode) at \(result.position)")

    if let confidence = result.confidence {
        print("Confidence: \(confidence)")
    }

    if let geo = result.geoCoordinates {
        print("Lat \(geo.latitude), lon \(geo.longitude)")
    }
}
```

***

## GeoCoordinates

Geographic position of the localized pose. Populated only when `geoCoordinatesInResponse` is enabled and the map is georeferenced in the portal.

| Property    | Type     | Description        |
| ----------- | -------- | ------------------ |
| `latitude`  | `Double` | WGS-84 latitude    |
| `longitude` | `Double` | WGS-84 longitude   |
| `altitude`  | `Double` | Altitude in metres |

***

## GeoPose

The full geographic pose the server returns when `geoCoordinatesInResponse` is enabled. `GeoCoordinates` carries only the position and is kept for existing integrations. `GeoPose` additionally exposes the orientation quaternion and the frame specification, which is what you need to draw a heading or record a pose faithfully.

Every field is optional, because the server may omit the block or any part of it.

| Property     | Type                  | Description                                                                                         |
| ------------ | --------------------- | --------------------------------------------------------------------------------------------------- |
| `frameModel` | `String?`             | The geodetic model, for example `"WGS-84"`                                                          |
| `frameName`  | `String?`             | The local tangent frame, for example `"Y-Up-ENU"`. Needed to read `quaternion` as a compass heading |
| `position`   | `GeoPose.Position?`   | Geographic position in the frame named by `frameName`                                               |
| `quaternion` | `GeoPose.Quaternion?` | Orientation within that frame                                                                       |

**GeoPose.Position**

| Property    | Type     |
| ----------- | -------- |
| `latitude`  | `Double` |
| `longitude` | `Double` |
| `altitude`  | `Double` |

**GeoPose.Quaternion**

| Property | Type    |
| -------- | ------- |
| `x`      | `Float` |
| `y`      | `Float` |
| `z`      | `Float` |
| `w`      | `Float` |

```swift
if let geoPose = result.geoPose,
   let position = geoPose.position,
   let quaternion = geoPose.quaternion {
    print("Frame: \(geoPose.frameName ?? "unknown")")
    print("Position: \(position.latitude), \(position.longitude)")
    print("Heading quaternion: \(quaternion.x), \(quaternion.y), \(quaternion.z), \(quaternion.w)")
}
```

***

## Supporting Enums

### LocalizationMode

| Value          | Description                                     |
| -------------- | ----------------------------------------------- |
| `.singleFrame` | Single frame capture, quick but lower accuracy  |
| `.multiFrame`  | Multi-frame capture, slower but higher accuracy |

### QueryMode

Applies to single-frame localization only. See [Query Mode](/multiset/native-sdk/ios-swift-native/api-reference/multisetconfig.md#query-mode-single-frame-only).

| Value   | Description                                                                 |
| ------- | --------------------------------------------------------------------------- |
| `.vps1` | Standard matching. Fastest response, best for well-mapped areas             |
| `.vps2` | Deep search. Slower, but recovers a pose in harder or sparsely mapped areas |

### TrackingState

| Value       | Description                       |
| ----------- | --------------------------------- |
| `.tracking` | AR tracking is working normally   |
| `.paused`   | AR tracking is temporarily paused |
| `.stopped`  | AR tracking has stopped           |

***

## Related

* [MultiSetCallback](/multiset/native-sdk/ios-swift-native/api-reference/multisetcallback.md)
* [MultiSetConfig](/multiset/native-sdk/ios-swift-native/api-reference/multisetconfig.md)
* [ARLocalizationView](/multiset/native-sdk/ios-swift-native/sample-views/arlocalizationview.md)


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://multiset.gitbook.io/multiset/native-sdk/ios-swift-native/api-reference/localizationresult.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
