Increase GPS drift threshold from 15m to 50m
Fixed issue where stationary stations like K5SGD-D were showing multiple positions due to minor GPS accuracy variations. The previous 15-meter threshold was too strict for typical GPS drift which can vary 5-30 meters. - Increased default threshold in GeoUtils from 10m to 50m - Updated packet processor to use 50m threshold for movement detection - Verified with K5SGD-D showing ~24m variations that are now ignored 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9b034cd211
commit
b4206b63d1
2 changed files with 5 additions and 5 deletions
|
|
@ -39,9 +39,9 @@ defmodule Aprsme.GeoUtils do
|
|||
Check if the distance between two points exceeds a minimum threshold.
|
||||
This helps filter out GPS drift and insignificant movements.
|
||||
|
||||
Default threshold is 10 meters to account for typical GPS accuracy.
|
||||
Default threshold is 50 meters to account for typical GPS accuracy variations.
|
||||
"""
|
||||
def significant_movement?(lat1, lon1, lat2, lon2, threshold_meters \\ 10) do
|
||||
def significant_movement?(lat1, lon1, lat2, lon2, threshold_meters \\ 50) do
|
||||
case haversine_distance(lat1, lon1, lat2, lon2) do
|
||||
nil -> false
|
||||
distance -> distance > threshold_meters
|
||||
|
|
|
|||
|
|
@ -60,11 +60,11 @@ defmodule AprsmeWeb.MapLive.PacketProcessor do
|
|||
|
||||
# Check if we have valid existing coordinates
|
||||
if is_number(existing_lat) and is_number(existing_lon) and
|
||||
GeoUtils.significant_movement?(existing_lat, existing_lon, lat, lon, 15) do
|
||||
# Significant movement detected (more than 15 meters), update the marker
|
||||
GeoUtils.significant_movement?(existing_lat, existing_lon, lat, lon, 50) do
|
||||
# Significant movement detected (more than 50 meters), update the marker
|
||||
handle_valid_postgres_packet(packet, lat, lon, socket)
|
||||
else
|
||||
# Just GPS drift or invalid coordinates, update the packet data but don't send visual update
|
||||
# Just GPS drift (less than 50 meters) or invalid coordinates, update the packet data but don't send visual update
|
||||
new_visible_packets = Map.put(socket.assigns.visible_packets, callsign_key, packet)
|
||||
assign(socket, :visible_packets, new_visible_packets)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue