% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geo-lite-struct.R
\encoding{UTF-8}
\name{geo_lite_struct}
\alias{geo_lite_struct}
\title{Search for addresses with structured queries}
\usage{
geo_lite_struct(
  amenity = NULL,
  street = NULL,
  city = NULL,
  county = NULL,
  state = NULL,
  country = NULL,
  postalcode = NULL,
  lat = "lat",
  long = "lon",
  limit = 1,
  full_results = FALSE,
  return_addresses = TRUE,
  verbose = FALSE,
  nominatim_server = "https://nominatim.openstreetmap.org/",
  custom_query = list()
)
}
\arguments{
\item{amenity}{A character string specifying the name or type of amenity. See
\code{\link[=geo_amenity]{geo_amenity()}}.}

\item{street}{A character string specifying the house number and street name.}

\item{city}{A character string specifying the city.}

\item{county}{A character string specifying the county.}

\item{state}{A character string specifying the state.}

\item{country}{A character string specifying the country.}

\item{postalcode}{A character string specifying the postal code.}

\item{lat}{A character string specifying the name of the latitude column in
the output. Defaults to \code{"lat"}.}

\item{long}{A character string specifying the name of the longitude column
in the output. Defaults to \code{"lon"}.}

\item{limit}{A positive integer specifying the maximum number of results to
return per query. Nominatim returns at most 50 results per query.}

\item{full_results}{A logical value indicating whether to return all
available fields from the Nominatim API. If \code{FALSE}, only query metadata,
location data and requested address columns are returned.}

\item{return_addresses}{A logical value indicating whether to include
single-line addresses in the results.}

\item{verbose}{A logical value indicating whether to display detailed
messages in the console.}

\item{nominatim_server}{A character string specifying the base URL of the
Nominatim server. Defaults to
\code{"https://nominatim.openstreetmap.org/"}.}

\item{custom_query}{A named list of additional API parameters, for example
\code{list(countrycodes = "US")}. See \strong{Details}.}
}
\value{
A \code{\link[dplyr:tibble]{tibble}} with the results that match the query.
}
\description{
Searches for addresses already split into components and returns matching
results as a \link[dplyr:tibble]{tibble}. Use \code{\link[=geo_lite_struct_sf]{geo_lite_struct_sf()}} to return
an \code{\link[sf:st_sf]{sf}} object instead.

This function performs the \strong{structured address search} described in the
\href{https://nominatim.org/release-docs/latest/api/Search/}{API endpoint}. To
perform a free-form search, use \code{\link[=geo_lite]{geo_lite()}}.
}
\details{
A structured address search accepts an address already split into components.
Each argument represents an address field. All components are optional, so
provide only those relevant to the address you want to find.

See \url{https://nominatim.org/release-docs/latest/api/Search/} for additional
parameters to pass to \code{custom_query}.
}
\examples{
\dontshow{if (nominatim_check_access()) withAutoprint(\{ # examplesIf}
\donttest{
pl_mayor <- geo_lite_struct(
  street = "Plaza Mayor", country = "Spain",
  limit = 50, full_results = TRUE
)

dplyr::glimpse(pl_mayor)
}
\dontshow{\}) # examplesIf}
}
\seealso{
Address search functions:
\code{\link[=geo_lite]{geo_lite()}},
\code{\link[=geo_lite_sf]{geo_lite_sf()}},
\code{\link[=geo_lite_struct_sf]{geo_lite_struct_sf()}}
}
\concept{geocoding}
