Skip to content

LocationFilterPolicy

export const LocationFilterPolicy = {

Defines the filtering policy applied to incoming raw GPS samples before they are accepted, averaged, or rejected by the LocationFilter.

The filtering policy determines how aggressively the plugin removes noisy, inaccurate, or redundant location updates. It represents the first stage in the SDK’s data-quality pipeline — before Kalman smoothing, burst averaging, or other denoising steps are applied.

Choosing the correct policy depends on your app’s tolerance for jitter versus responsiveness:

  • Fitness or vehicle-tracking apps often prefer stronger filtering.
  • Survey or scientific apps may prefer capturing unmodified raw samples.

Profiles

Policy Description Use Case
LocationFilterPolicy.PassThrough No filtering. Every received sample is recorded, even if noisy or identical to the previous one. Debugging, diagnostics, scenarios requiring raw data.
LocationFilterPolicy.Adjust Balanced filtering. Smooths and rejects only clearly invalid samples. (Default) Most use cases — walking, cycling, automotive tracking.
LocationFilterPolicy.Conservative Strict filtering. Strongly smooths data and rejects high-variance samples, prioritizing stability over responsiveness. Analytics, long-term background logging, noise-sensitive applications.

Notes

Examples

BackgroundGeolocation.ready({
  geolocation: {
    filter: {
      policy: LocationFilterPolicy.Adjust
    }
  }
});
BackgroundGeolocation.ready({
  geolocation: {
    filter: {
      policy: LocationFilterPolicy.PassThrough
    }
  }
});
BackgroundGeolocation.ready({
  geolocation: {
    filter: {
      policy: LocationFilterPolicy.Conservative
    }
  }
});

See also - GeoConfig.filter - LocationFilter - KalmanProfile

Balanced default filtering
BackgroundGeolocation.ready({
  geolocation: {
    filter: {
      policy: LocationFilterPolicy.Adjust
    }
  }
});
No filtering — capture all raw locations
BackgroundGeolocation.ready({
  geolocation: {
    filter: {
      policy: LocationFilterPolicy.PassThrough
    }
  }
});
Maximum smoothing for analytics
BackgroundGeolocation.ready({
  geolocation: {
    filter: {
      policy: LocationFilterPolicy.Conservative
    }
  }
});

Members

Adjust

Balanced (default) — applies moderate filtering to reject noisy samples.

Dynamically adjusts acceptance thresholds for incoming samples, but never alters the raw latitude/longitude coordinates.

When using LocationFilterPolicy.Adjust (the default), the SDK computes motion metrics such as:

  • distance deltas
  • implied speed
  • accuracy variance
  • heading stability

It then applies adaptive gating rules to decide whether each sample should be:

  • accepted
  • ignored
  • rejected as noise

Coordinates are never modified. This policy adjusts which samples are included, not how they are positioned.

If LocationFilter.useKalman is enabled, additional smoothing may occur, but the physical coordinates of each accepted sample remain untouched.

Conservative

Aggressive — filters heavily, preferring stability over responsiveness.

PassThrough

No filtering — accept all samples. Useful for debugging.