aprs.me/test/aprsme/packets
Graham McIntire 47fc071263
Add get_nearby_weather_stations/4 query function with spatial filtering
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)
2026-03-22 11:27:45 -05:00
..
clustering_test.exs Move client-side logic to server-side LiveView 2026-02-20 08:54:34 -06:00
prepared_queries_test.exs Add get_nearby_weather_stations/4 query function with spatial filtering 2026-03-22 11:27:45 -05:00
query_builder_test.exs Use PostGIS GiST index for spatial bounds queries 2026-02-20 07:29:27 -06:00