LocationNameResolver

Resolves a coordinate to a short, human-readable place name (reverse geocoding).

Implementations run off the main thread and must never throw: an unresolved coordinate (no geocoder, no network, no match, or an error) resolves to a PlaceName whose PlaceName.name is null, so callers always have the formatted PlaceName.coordinates fallback to fall back on.

  • Android: Geocoder (async GeocodeListener on API 33+, blocking on Dispatchers.IO below).

  • iOS: CLGeocoder (or a coords-only stub where reverse geocoding is unavailable).

Inheritors

Functions

Link copied to clipboard
abstract suspend fun resolve(latitude: Double, longitude: Double): PlaceName

Resolve latitude/longitude to a PlaceName; suspends, never throws.