ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Core.DeviceLocation Namespace / DeviceLocationProperties Class / AccuracyThreshold Property
Example

In This Topic
    AccuracyThreshold Property
    In This Topic
    Gets and sets the acceptable accuracy threshold in meters.
    Syntax
    Public Property AccuracyThreshold As Double
    public double AccuracyThreshold {get; set;}
    Remarks
    When the quality of the device location falls outside of the AccuracyThreshold, the color of the location symbol shown on the map will switch from blue to red. The AccuracyThreshold may also have an impact on editing.
    Example
    Connect to a Device Location Source
    {
        var newSrc = new SerialPortDeviceLocationSource();
        //Specify the COM port the device is connected to
        newSrc.ComPort = "Com3";
        newSrc.BaudRate = 4800;
        newSrc.AntennaHeight = 3;  // meters
                                   //fill in other properties as needed
    
        var props = new DeviceLocationProperties();
        props.AccuracyThreshold = 10;   // meters
    
        // jump to the background thread
        //Note: Run within a QueuedTask
        //open the device
        DeviceLocationService.Instance.Open(newSrc, props);
    }
    Get Current Device Location Source and Properties
    {
        // Check if a device is connected
        bool isConnected = DeviceLocationService.Instance.IsDeviceConnected();
        if (!isConnected)
            return; // no device connected
                    // Get the current device location source
        var src = DeviceLocationService.Instance.GetSource();
        // Check if the source is a SerialPortDeviceLocationSource
        //Set values for the SerialPortDeviceLocationSource
        if (src is SerialPortDeviceLocationSource serialPortSrc)
        {
            var port = serialPortSrc.ComPort;
            var antennaHeight = serialPortSrc.AntennaHeight;
            var dataBits = serialPortSrc.DataBits;
            var baudRate = serialPortSrc.BaudRate;
            var parity = serialPortSrc.Parity;
            var stopBits = serialPortSrc.StopBits;
    
            // retrieving spatial reference needs the MCT
            var sr = await QueuedTask.Run(() =>
            {
                return serialPortSrc.GetSpatialReference();
            });
    
        }
        //Get current device location properties being used.
        var dlProps = DeviceLocationService.Instance.GetProperties();
        var accuracy = dlProps.AccuracyThreshold;
    }
    Update Properties on the Current Device Location Source
    {
        //Note: Run within QueuedTask
        // Get the current device location properties
        var dlProps = DeviceLocationService.Instance.GetProperties();
        //Change the accuracy threshold
        dlProps.AccuracyThreshold = 22.5; // meters
                                          // Update the properties on the device location source
        DeviceLocationService.Instance.UpdateProperties(dlProps);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also