feat: Add position ambiguity support from APRS parser

- Added position_ambiguity field (integer, 0-4) to packets table
- Created migration to add the new database column
- Updated packet schema and processing to extract position ambiguity
- Position ambiguity levels indicate precision of reported coordinates:
  - 0: No ambiguity (exact position)
  - 1: ~0.1 mile ambiguity
  - 2: ~1 mile ambiguity
  - 3: ~10 mile ambiguity
  - 4: ~60 mile ambiguity
- Automatically captures ambiguity level when parsing APRS packets
- All tests pass with no failures

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Graham McIntire 2025-08-01 16:21:19 -05:00
parent 47018a55bb
commit 82e97e5e31
No known key found for this signature in database
4 changed files with 19 additions and 1 deletions

View file

@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Automatically drains connections when node is overloaded (>70% CPU or 2x average connections)
- Gracefully reconnects clients to less loaded nodes
- Improves overall cluster stability and performance
- Position ambiguity support from APRS parser
- Added `position_ambiguity` field to packets table (integer, 0-4)
- Automatically captures position ambiguity level when parsing APRS packets
- Supports ambiguity levels 0-4 as defined in APRS specification
### Changed
- Query performance improved by 50-90% for common operations

View file

@ -52,6 +52,9 @@ defmodule Aprsme.Packet do
field(:speed, :float)
field(:altitude, :float)
# Position ambiguity level (0-4)
field(:position_ambiguity, :integer)
# PHG (Power-Height-Gain) fields
field(:phg_power, :integer)
field(:phg_height, :integer)
@ -115,6 +118,7 @@ defmodule Aprsme.Packet do
:course,
:speed,
:altitude,
:position_ambiguity,
:phg_power,
:phg_height,
:phg_gain,
@ -346,6 +350,7 @@ defmodule Aprsme.Packet do
:aprs_messaging,
data_extended[:aprs_messaging?] || data_extended["aprs_messaging?"]
)
|> maybe_put(:position_ambiguity, data_extended[:position_ambiguity] || data_extended["position_ambiguity"])
end
defp put_weather_fields(map, data_extended) do

View file

@ -0,0 +1,9 @@
defmodule Aprsme.Repo.Migrations.AddPositionAmbiguityToPackets do
use Ecto.Migration
def change do
alter table(:packets) do
add :position_ambiguity, :integer
end
end
end

2
vendor/aprs vendored

@ -1 +1 @@
Subproject commit 49b5225fe8b3212bab2833cfbf1032a030010022
Subproject commit 46ece8d819b6ceb67b55dfe689cab68c665c978b