docs: reverse geocode backend implementation — 3 server-side paths

2026-05-20 18:09:34 -04:00
parent d70682bffa
commit 5bdee53397
+8 -3
@@ -14,12 +14,17 @@ Mobile-first web app for tracking physical assets via barcode scanning, OCR stic
## Recent Changes (May 2026)
### Reverse Geocode — Backend Auto-fill Address from GPS
`reverse_geocode()` helper calls OpenStreetMap Nominatim. Wired into all 3 server-side asset creation/update paths:
- **POST /api/assets** — if lat/lng present and address empty, auto-populates `address`, `building_name`, `building_number`
- **PUT /api/assets/{id}** — when lat/lng updated, also reverse geocodes address fields
- **POST /api/checkins** — when auto-updating asset location from check-in, also reverse geocodes address
- **GET /api/geocode?lat=&lng=** — public API endpoint using same helper
- Graceful fallback: returns None on Nominatim failure, address fields left as-is
### GPS Button for Parking Location
Added 📍 GPS button next to `parking_location` field in both Add Asset and Edit forms. Clicking fills current GPS coordinates into the text field. Shows toast if GPS unavailable.
### Reverse Geocode — Auto-fill Address from GPS
When creating an asset (all 3 modes: barcode, OCR, manual), the app reverse-geocodes current GPS via OpenStreetMap Nominatim (`GET /api/geocode`). Address, Building Number, and Building Name fields auto-populate. Only fills empty fields.
### Navigation Tool
Tap "🧭 Navigate" on any asset detail view to draw a route line on the map from your current GPS position to the asset. Shows distance, cardinal direction, and a Google Maps link. Also accessible from map pin popups.