MazamaLocationUtils (version 0.1.6)

location_createID: Create one or more unique locationIDs

Description

A unique locationID is created for each incoming longitude and latitude. The following code is used to generate each locationID. See the references for details.

# Retain accuracy up to ~.1m
locationString <- paste0(
  sprintf("
  "_",
  sprintf("
)

# Avoid collisions until billions of records locationID <- digest::digest(locationString, algo = "xxhash64")

Usage

location_createID(longitude = NULL, latitude = NULL)

Arguments

longitude

Single longitude in decimal degrees E, Default: NULL

latitude

Single latitude in decimal degrees N, Default: NULL

Value

Vector of character locationIDs.

References

https://en.wikipedia.org/wiki/Decimal_degrees

https://www.johndcook.com/blog/2017/01/10/probability-of-secure-hash-collisions/

Examples

Run this code
# NOT RUN {
# Wenatchee
lon <- -120.325278
lat <- 47.423333
locationID <- location_createID(lon, lat)
# }

Run the code above in your browser using DataLab