diff --git a/lib/aprsme/geo_utils.ex b/lib/aprsme/geo_utils.ex index 8fec9eb..a396e64 100644 --- a/lib/aprsme/geo_utils.ex +++ b/lib/aprsme/geo_utils.ex @@ -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 diff --git a/lib/aprsme_web/live/map_live/packet_processor.ex b/lib/aprsme_web/live/map_live/packet_processor.ex index 991bce1..8441add 100644 --- a/lib/aprsme_web/live/map_live/packet_processor.ex +++ b/lib/aprsme_web/live/map_live/packet_processor.ex @@ -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