Implements PostGIS-based query to find weather stations within a radius: - Uses ST_DWithin for efficient spatial filtering within radius (miles to meters) - Orders results by ST_Distance (closest first) - Filters by has_weather, has_position, and time window (default 6h) - Deduplicates by base_callsign using DISTINCT ON (avoids duplicate SSIDs) - Returns all weather fields: temp, humidity, pressure, wind, rain - Configurable limit (default 50) and hours options Comprehensive test coverage (10 tests): - Spatial filtering within/outside radius - Time window filtering - Base callsign deduplication (most recent SSID) - Distance ordering verification - Required field validation - Edge cases (empty results, no weather data) |
||
|---|---|---|
| .. | ||
| aprsme | ||
| aprsme_web | ||
| mix/tasks | ||
| aprs_web.ex | ||
| aprsme.ex | ||