MazamaLocationUtils (version 0.1.6)

location_getSingleAddress_Photon: Get address data from the Photon API to OpenStreetMap

Description

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

  • zip

  • 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.

Usage

location_getSingleAddress_Photon(longitude = NULL, latitude = NULL,
  verbose = TRUE)

Arguments

longitude

Single longitude in decimal degrees E, Default: NULL

latitude

Single latitude in decimal degrees N, Default: NULL

verbose

Logical controlling the generation of progress messages.

Value

List of address components.

References

http://photon.komoot.de

Examples

Run this code
# NOT RUN {
# Set up standard directories and spatial data
spatialDataDir <- tempdir() # typically "~/Data/Spatial"
mazama_initialize(spatialDataDir)

# Wenatchee
lon <- -120.325278
lat <- 47.423333
addressList <- location_getSingleAddress_Photon(lon, lat)
str(addressList)
# }

Run the code above in your browser using DataCamp Workspace