Phase 5c: GPS Nearby Locations (Overpass API)
Goal: Auto-detect nearest McDonald's via GPS coordinates + OpenStreetMap Overpass API. The location picker has a backend.
Owner: Dev agent
Repo:
forgejo_admin/mcd-tracker-apiDepends on: Phase 5 (COMPLETED)
Scope
Implements
arch-dataflow-mcd-tracker#flow-5-auto-detect-location. Uses the Overpass API (OpenStreetMap) to find McDonald's near the user's GPS coordinates. Free, no API key, well-mapped for US chain restaurants.- Add
GET /locations/nearby?lat=39.74&lng=-104.99&radius=5000endpoint: - Add
src/mcd_tracker_api/services/overpass.py— Overpass API client (httpx) - Add distance calculation utility (Haversine formula for lat/lng distance)
- Update Location model: ensure latitude/longitude are required for new locations (nullable for legacy)
- Integration tests with mocked Overpass responses (don't hit real API in CI)
- pending
Related
phase-mcd-tracker-5-core-api— parent phaseplan-mcd-tracker— parent planarch-dataflow-mcd-tracker#flow-5-auto-detect-location— GPS flow