Situm is able to provide Indoor & Outdoor Positioning. How Situm SDK handles Indoor Positioning has been explained in detail in previous sections. In this section, we review the most important Outdoor Positioning configurations that Situm offers.


As a prerrequisite, take into account Outdoor Positioning is only available when using Situm SDK in Global Mode. The following code snippet shows an example of an specific configurations that we may wish to apply to Situm SDK's outdoor positioning. See next sections for details.


//A sample configuration of the outdoor positioning options
OutdoorLocationOptions outdoorLocationOptions = new OutdoorLocationOptions.Builder(). 
buildingDetector(OutdoorLocationOptions.BuildingDetector.WIFI_AND_BLE). 
scansBasedDetectorAlwaysOn(false).
enableOpenSkyDetector(false).
useGeofencesInBuildingSelector(true). 
build();        

LocationRequest locationRequest = new 
LocationRequest.Builder().outdoorLocationOptions(outdoorLocationOptions).build();


1. Building detector


One of the many outdoor positioning options that we may configure relates to how Situm SDK detects whether we are inside or outside a building configured with Situm. This is achieved through the OutdoorLocationOptions.Builder().buildingDetector method, as explained in detail in the Building vs Global Mode section.


2. Enable/Disable outdoor positioning


For a number of reasons, you may want to disable outdoor positioning while using Global Mode. For instance, you may want to enable indoor positioning with automatic building detection, but without allowing Situm SDK to compute outdoor positions when you are not in a known building.  This is common, for example, if you want to make sure that users are not tracked outside the buildings' surroundings.


You may achieve this by using the OutdoorLocationOptions.Builder().enableOutdoorPositions method, as shown on the following snippet. Note that if you disable outdoor positioning, the GPS based building detector will not work. Therefore, you should set a different building detector (e.g. WiFi & BLE as in the following snippet, or any other). 

//Outdoor Positioning is enabled by default
OutdoorLocationOptions outdoorLocationOptions = new OutdoorLocationOptions.Builder().build();
 
//You may disable it by setting enableOutdoorPositions to false
OutdoorLocationOptions outdoorLocationOptions = new OutdoorLocationOptions.Builder().
                enableOutdoorPositions(false).
                buildingDetector(OutdoorLocationOptions.BuildingDetector.WIFI_AND_BLE).
               .build();

 

 

3. Compute and Update Intervals


Situm SDK allows you to control de frequency with which:

  1. Outdoor positions are computed, using the OutdoorLocationOptions.Builder().computeInterval method.
  2. Outdoor positions are delivered via the LocationListener.onLocationChanged callback, using the OutdoorLocationOptions.Builder().updateInterval method.


Both methods are described in detail (including code snippets) in this section


4. Minimum Outdoor Accuracy


In addition to controlling the outdoor positioning frequency parameters (see previous section), Situm SDK allows you to filter out outdoor positioning that do not meet a certain accuracy criteria. You may do this by using the OutdoorLocationOptions.Builder().minimumOutdoorLocationAccuracy method. See this section for details and code examples.


5. Open Sky Detector (not recommended)


As explained in this section, Situm SDK offers a way to determine whether the smartphone is located "under roof" or "under open sky" based on the  SNR (Signal-Noise-Ratio) of the GPS signals received. This is usually useful if, for whatever reason, you want to compute Outdoor Positions when the user is within the building's canvas in outdoor open spaces ("under open sky"). 


By default, this mode is disabled since its use is not recommended. 


//By default the OpenSky detector is disabled
OutdoorLocationOptions outdoorLocationOptions = new OutdoorLocationOptions.Builder().build();        

//You may also disable it explicitly
OutdoorLocationOptions outdoorLocationOptions = new OutdoorLocationOptions.Builder(). 
enableOpenSkyDetector(false).
build();        


If you still want to do it, you may want to use the OutdoorLocationOptions.Builder().enableOpenSkyDetector and OutdoorLocationOptions.Builder().averageSnrThreshold methods.

//Enables the OpenSky detector and sets the SNR threshold to 17dBms (above this value, the smartphone will be considered to be under "open sky"

OutdoorLocationOptions outdoorLocationOptions = new OutdoorLocationOptions.Builder(). 
enableOpenSkyDetector(true).
averageSnrThreshold(17.0).
build();        



In order to know which SNR value is the most adequate for your building, we recommend to test how different values work using our Situm Mapping Tool app as explained in this guide. As a reference, the typical SNR range of a satellite signal is in the [0, 40] dBm range. Typical indoor values are in the [0, 20] dBm range, where 0 dBm is the typical value under a thick roof, 10 dBm under a thin roof and 20 dBm under a glass roof. Typical outdoor values are in the [15, 40] dBm range, where 15 dBm is the typical when the user is outdoors but close or under elements that might block GPS signals (such as big buildings or trees), 25 the typical value under open sky. Values above 30 are rare except for smartphone with a very good GPS chip. These values should be taken as an approximate reference; they depend heavily on the smartphone quality and environment conditions.