Resolves a user-provided location to latitude/longitude. Prefer explicit coordinates when available; optionally fall back to AI/geocoding rules if needed.
resolve_location(
location_input = NULL,
latitude = NULL,
longitude = NULL,
use_ai = TRUE,
use_cache = TRUE
)Character. Free-text location description (e.g. "Wagga Wagga, NSW").
Numeric. Latitude if already known.
Numeric. Longitude if already known.
Logical. Whether to use AI fallback when no coordinates are provided. Default: TRUE.
Logical. Whether to use caching for AI responses. Default: TRUE.
A list with latitude (numeric or NULL), longitude (numeric or NULL), display_name (character or NULL), source (resolution method: "provided_coordinates", "ai_resolution", or "unknown"), confidence (confidence level: "high" or "low"), raw_input (original input), and assumptions (any assumptions made during resolution).
if (FALSE) { # \dontrun{
# Resolve location from explicit coordinates
result <- resolve_location(latitude = -35.1, longitude = 147.4, location_input = "Wagga Wagga")
# Resolve location from text description using AI
result <- resolve_location("Wagga Wagga, NSW", use_ai = TRUE)
} # }