NsdkMapStorage
A storage system for managing device-generated maps....
Declaration
final class NsdkMapStorageSummary
A storage system for managing device-generated maps. The map storage feature provides capabilities for capturing, storing, and managing map data from AR sessions. This data can be persisted and used for Visual Positioning System (VPS) localization and map updates.
Methods
| Name | Type | Summary |
|---|---|---|
| addMap | void | |
| clear | void | Clears the map storage. This method removes all stored map data and localization data - Note: Must not be called if VPS is running. If called, localization data will be discarded and the session state will be undefined. |
| createRootAnchor | String? | Creates an anchor on the existing map located at the origin of the current AR session, if possible. The root anchor represents the origin point of the map coordinate system and can be used with VPS for localization. - Returns: The payload of the root anchor, encoded as a base64 string if available, nil if otherwise. |
| extractMapMetadata | MapMetadata? | Extracts metadata from a map relative to a specified anchor. Render the feature points in the metadata relative to the specified anchor to visualize the map. This is only possible when the anchor is linked directly to the map's node(s), or if the anchor's nodes are reachable to the map's nodes from the currently active transform graph. - Parameter anchorPayload: The base64-encoded payload of the anchor that the returned points will be relative to. - Parameter map: The map buffer to extract metadata from. - Returns: The metadata of the map if successful, nil if otherwise.- Throws: NsdkError.invalidArgumentor NsdkError.nullArgumentindicating a problem with either argument. Check NSDK's C logs for more information. |
| mapData | NsdkBuffer? | Gets the complete map data. This function returns all the map data accumulated during the AR session, serialized as a DeviceMap protobuf. This data can be saved, shared, and/or used for localization. - Returns: The serialized map data buffer if available, nil if no map data exists. |
| mapUpdate | NsdkBuffer? | Gets the latest map update data. This method returns the incremental map changes (new nodes and edges) that have been added since the last update. - Returns: The serialized map update if available, nil if no updates exist. |
| mergeMapUpdate | NsdkBuffer | Merges a map update into an existing map. This method combines incremental map updates with a base map to produce a merged map buffer containing the complete map data. - Parameter existingMap: The existing map to merge the update into. - Parameter mapUpdate: The map update to merge into the existing map. - Returns: The merged map buffer - Throws: NsdkError of type NsdkError.invalidArgumentorNsdkError.nullArgument indicating a problem with eitherargument . Check NSDK's C logs for more information. |
- Parameter map: The serialized map data to add. It should be encoded as a
DeviceMap protobuf and can be obtained from
mapData(),mapUpdate(),or
mergeMapUpdate(existingMap:mapUpdate:).- Throws:
NsdkError.invalidArgumentorNsdkError.nullArgumentindicating a problem with the
mapargument . Check NSDK's C logs for more information.