Learn R Programming

MazamaLocationUtils (version 0.4.4)

location_getOpenCageInfo: Get location information from OpenCage

Description

The OpenCage reverse geocoding service is used to obtain all available information for a specific location.

The data from OpenCage should be considered to be the gold standard for address information could and should be used to override information we get elsewhere.

Usage

location_getOpenCageInfo(longitude = NULL, latitude = NULL, verbose = FALSE)

Value

Single-row tibble with OpenCage information.

Arguments

longitude

Single longitude in decimal degrees E.

latitude

Single latitude in decimal degrees N.

verbose

Logical controlling the generation of progress messages.

References

https://opencagedata.com

Examples

Run this code
# \donttest{
library(MazamaLocationUtils)

# Fail gracefully if any resources are not available
try({

  # Wenatchee
  lon <- -120.325278
  lat <- 47.423333

  Sys.setenv("OPENCAGE_KEY" = "YOUR_PERSONAL_API_KEY")

  openCageTbl <- location_getOpenCageInfo(lon, lat)
  dplyr::glimpse(openCageTbl)
  
}, silent = FALSE)
# }

Run the code above in your browser using DataLab