From 26d7a2c0b74837f1f97429249d13b4b3369b7d9d Mon Sep 17 00:00:00 2001 From: Ryan McGuire Date: Fri, 26 Jun 2026 22:37:47 -0400 Subject: [PATCH] update README for filters --- README.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e644002..0dd86c8 100644 --- a/README.md +++ b/README.md @@ -145,10 +145,27 @@ heavies, _ := c.Aircraft(ctx, ) ``` -Available filters include `WithPosition`, `WithHex`, `WithCallsign`, -`WithSquawk`, `WithCategory`, `WithType`, `InEmergency`, `IsMLAT`, -`MinAltitude`, `MaxAltitude`, `OnGround`, `WithinNM`, `SeenWithin`, `MinRSSI`, -plus the `Not` and `Any` combinators. +| Filter Name | Description | Sample Usage | +|---|---|---| +| `WithPosition` | Keeps only aircraft that currently report a lat/lon. | `readsb.WithPosition()` | +| `WithHex` | Keeps aircraft whose ICAO address matches any of the given values. | `readsb.WithHex("A1B2C3", "D4E5F6")` | +| `WithCallsign` | Keeps aircraft whose (trimmed) callsign matches any value. | `readsb.WithCallsign("UAL2350")` | +| `WithSquawk` | Keeps aircraft transmitting any of the given Mode A squawk codes. | `readsb.WithSquawk("7700")` | +| `WithCategory` | Keeps aircraft of any of the given emitter categories. | `readsb.WithCategory(readsb.CatLarge)` | +| `WithType` | Keeps aircraft of any of the given source types. | `readsb.WithType(readsb.TypeMLAT)` | +| `InEmergency` | Keeps only aircraft squawking a non-routine emergency/priority code. | `readsb.InEmergency()` | +| `IsMLAT` | Keeps only aircraft whose position was derived by multilateration. | `readsb.IsMLAT()` | +| `MinAltitude` | Keeps airborne aircraft at or above the given barometric altitude (feet). | `readsb.MinAltitude(30000)` | +| `MaxAltitude` | Keeps aircraft at or below the given barometric altitude (feet); on-ground aircraft always pass. | `readsb.MaxAltitude(10000)` | +| `OnGround` | Keeps only aircraft reporting an on-ground barometric altitude. | `readsb.OnGround()` | +| `MinSpeed` | Keeps aircraft at or above knots, measured by src (GroundSpeed or TrueAirspeed). | `readsb.MinSpeed(200, readsb.GroundSpeed)` | +| `MaxSpeed` | Keeps aircraft with a positive reading at or below knots, measured by src; aircraft with no reading are dropped. | `readsb.MaxSpeed(500, readsb.TrueAirspeed)` | +| `WithinNM` | Keeps aircraft within the given range (nautical miles) of the receiver. | `readsb.WithinNM(30)` | +| `WithinNMOf` | Keeps aircraft whose current position is within nm nautical miles of the given point (decimal degrees). | `readsb.WithinNMOf(40.7, -74.0, 50)` | +| `SeenWithin` | Keeps aircraft heard from within the given duration. | `readsb.SeenWithin(5*time.Minute)` | +| `MinRSSI` | Keeps aircraft whose average signal strength is at or above dbfs (e.g. -24). | `readsb.MinRSSI(-24)` | +| `Not` | Inverts a filter. | `readsb.Not(readsb.OnGround())` | +| `Any` | Keeps aircraft matching at least one of the supplied filters (logical OR). | `readsb.Any(f1, f2)` | ### Streaming