Learn R Programming

MazamaLocationUtils (version 0.3.11)

location_createID: Create one or more unique locationIDs

Description

A unique locationID is created for each incoming longitude and latitude.

See MazamaCoreUtils::createLocationID for details.

Usage

location_createID(
  longitude = NULL,
  latitude = NULL,
  algorithm = c("digest", "geohash")
)

Value

Vector of character locationIDs.

Arguments

longitude

Vector of longitudes in decimal degrees E.

latitude

Vector of latitudes in decimal degrees N.

algorithm

Algorithm to use -- either "digest" or "geohash".

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
library(MazamaLocationUtils)

# Wenatchee
lon <- -120.325278
lat <- 47.423333
locationID <- location_createID(lon, lat)
print(locationID)

geohashID <- location_createID(lon, lat, algorithm = "geohash")
print(geohashID)

Run the code above in your browser using DataLab