Urgent.News

What's breaking now, across thousands of outlets.

Tech

One global threshold is how you delete valid data

Our GPS filter worked perfectly, right up until someone sat in Bangalore traffic. The phantom distance problem A parked phone does not sit still in the data. The reported position wanders a few metres in every direction, and if you naively sum the gaps between readings, a stationary car quietly accumulates kilometres. On a mileage app that becomes an expense claim, so it matters. The fix looks…

The GPS filter performed flawlessly until a driver in Bangalore traffic interfered with its accuracy. Stationary phones exhibit random wandering, with a parked phone drifting by several meters. Reporting this wandering distance as movement is problematic, especially when expense claims are generated based on the mileage app. A simple fix addresses this issue: ignore displacement below a minimum threshold, which was set to 5.0 meters.

This threshold effectively eliminates false movements caused by parked cars. However, the constant threshold of 5.0 meters is problematic because it does not account for the context in which the data is generated. Factors such as speed, time gaps, and recent history must be considered to determine whether a movement is valid or not.

To set an effective threshold, three key factors should be taken into account: speed bands, time gap tiers, and recent history. Speed bands classify movements based on the speed at which they occur, with faster travel tolerating larger displacement steps than slower travel. Time gap tiers consider the duration since the last recorded movement, with longer gaps allowing for larger displacement.

Recent history looks at the recent speed history to determine if there has been any movement, rather than just relying on a single displacement measurement. These factors ensure that the threshold is context-dependent, rather than a one-size-fits-all constant. By making these thresholds configurable, they can be easily adjusted to suit different contexts, making the filter more accurate and reliable.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How I ended up with a 2.9 kB GZip reactive UI engine that runs from a static file

A few weeks ago, I was working on a side project. Nothing fancy — just a small dashboard with a form, a list, and a few buttons. The kind of thing that should take an afternoon.

  • Engineer creates 2.9 kB GZip reactive UI engine
  • Uses vanilla JavaScript with DOMParser, Proxy, and Child index paths
  • Operates by registering dynamic elements and mapping state changes

More from Monday 14 September →