Skip to main content

Map Selection

In order to start map-based relocalization, the SDK needs to know which map to relocalize which is why it requires the Map Key of a map. Map Selection is a feature of the SDK to help the application choose which map to be used. We provide two map selection strategies by default, DirectMapSelection and CriteriaBasedMapSelection.

Direct Map Selection

Direct Map Selection is a strategy that will simply return what is assigned to it. In this case, we need to get the map key from developer console. You can create a DirectMapSelection asset by right-clicking the Project tab and select Create > Pretia Ar Cloud > Map Selection > Direct Map Selection. Copy the map key from Developer Console and assign it in the asset.

Criteria-based Map Selection

Manually setting the map key is tedious as you may need to create a new map when the environment changes. To accomodate these changes, we provide a way to select which map to use by evaluating some criteria. When creating a map, the 3D Scanner records the current time and also the device's GPS location. With these information, the SDK can select which map is most appropriate considering the device's current location and time. You can create CriteriaBasedMapSelection asset by right-clicking the Project tab and select Create > Pretia Ar Cloud > Map Selection > Criteria Based Map Selection. The SDK also provides two default criterias map selection asset, which is MapsInAreaCriteria and AllMapsCriteria to let you use the feature quickly.

*To show the default criterias when searching, make sure to toggle the visibility of package-based asset by pressing the slashed eye button.

For this strategy, the selection is done from the list of maps that has been assigned to the App Key used in the Unity project, so make sure that you have assigned some maps to the app from Developer Console before using this strategy.

Maps In Area Criteria

MapsInAreaCriteria will select the map closest to the current time within a radius of 50 meters.

All Maps Criteria

AllMapsCriteria will select the map closest in distance without any radius limit.

Custom Criteria

When creating a new criteria, you can further customize the parameter to limit the list of maps to evaluate. This section will explain each of the different criteria.

Public

You can choose for either PUBLIC_ONLY maps, PRIVATE_ONLY maps, or ANY to not filter based on whether the map is public or not.

Merged

You can choose for either MERGED_MAPS_ONLY, NOT_MERGED_MAPS_ONLY, MERGED_MAPS_IF_EXISTS to prioritize merged maps, or ANY to not filter based on whether the map is merged or not.

Group Keys

You can also further limit the list of maps to evaluate by adding group key to this list. The SDK will only evaluate maps that exists inside the assigned group keys. You can get the group key from the map management page of Developer Console.

Gps Threshold

Gps Threshold is the distance limit in meters. Maps further than this threshold will not be selected.

Time Threshold

Select maps that are closer in time than this threshold, based on current time. The time distance is normalized in [0 .. 1]. Closer to 0 means that the map is closer to the current daylight conditions.

Sorting

You can choose for either SORT_BY_GPS_DISTANCE, SORT_BY_TIME, or NO_SORTING.