View source: R/location_getSingleAddress_Photon.R
location_getSingleAddress_Photon | R Documentation |
The Photon API is used get address data associated with
the longitude
and latitude
. The following list of data
is returned:
houseNumber
street
city
stateCode
stateName
postalCode
countryCode
countryName
The function makes an effort to convert both state
and country
Name
into Code
with codes defaulting to NA
. Both
Name
and Code
are returned so that improvements can be made in
the conversion algorithm.
location_getSingleAddress_Photon(
longitude = NULL,
latitude = NULL,
baseUrl = "https://photon.komoot.io/reverse",
verbose = TRUE
)
longitude |
Single longitude in decimal degrees E. |
latitude |
Single latitude in decimal degrees N. |
baseUrl |
Base URL for data queries. |
verbose |
Logical controlling the generation of progress messages. |
List of address components.
library(MazamaLocationUtils)
# Fail gracefully if any resources are not available
try({
# Set up standard directories and spatial data
spatialDataDir <- tempdir() # typically "~/Data/Spatial"
initializeMazamaSpatialUtils(spatialDataDir)
# Wenatchee
lon <- -120.325278
lat <- 47.423333
addressList <- location_getSingleAddress_Photon(lon, lat)
str(addressList)
}, silent = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.