Skip to content

Commit

Permalink
feat: added 'algorithm' argument to location_createID()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Callahan authored and Jonathan Callahan committed Aug 29, 2023
1 parent d91bd5f commit 179708d
Show file tree
Hide file tree
Showing 66 changed files with 4,137 additions and 7,904 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Type: Package
Package: MazamaLocationUtils
Version: 0.3.10
Version: 0.3.11
Title: Manage Spatial Metadata for Known Locations
Authors@R: c(
person("Jonathan", "Callahan", email="[email protected]", role=c("aut","cre")),
Expand All @@ -16,17 +16,17 @@ License: GPL-3
URL: https://github.com/MazamaScience/MazamaLocationUtils
BugReports: https://github.com/MazamaScience/MazamaLocationUtils/issues
Depends:
R (>= 3.5)
R (>= 4.0)
Imports:
dplyr,
geodist (>= 0.0.7),
geodist (>= 0.0.8),
httr,
jsonlite,
leaflet,
lubridate,
magrittr,
methods,
MazamaCoreUtils (>= 0.4.10),
MazamaCoreUtils (>= 0.4.16),
MazamaSpatialUtils (>= 0.7),
readr,
rlang,
Expand All @@ -41,5 +41,5 @@ Suggests:
Encoding: UTF-8
VignetteBuilder: knitr
LazyData: true
RoxygenNote: 7.1.2
RoxygenNote: 7.2.3
Roxygen: list(markdown = TRUE)
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# MazamaLocationUtils 0.3.11

* Added `algorithm argument` to location_createID() to select between "digest"
and "geohash".
* Addressed CRAN package documentation issue.

# MazamaLocationUtils 0.3.10

* Added `na.rm = TRUE` to all calls to `any(...)` in various `table_~()` functions.
Expand Down
1 change: 1 addition & 0 deletions R/MazamaLocationUtils.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#'
#' @docType package
#' @name MazamaLocationUtils
#' @aliases MazamaLocationUtils-package
#' @title Manage Spatial Metadata for Known Locations
#' @description A suite of utility functions for discovering and managing
#' metadata associated with sets of spatially unique "known locations".
Expand Down
12 changes: 9 additions & 3 deletions R/location_createID.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#'
#' @param longitude Vector of longitudes in decimal degrees E.
#' @param latitude Vector of latitudes in decimal degrees N.
#' @param algorithm Algorithm to use -- either \code{"digest"} or \code{"geohash"}.
#' @return Vector of character locationIDs.
#' @examples
#' library(MazamaLocationUtils)
Expand All @@ -16,17 +17,22 @@
#' lat <- 47.423333
#' locationID <- location_createID(lon, lat)
#' print(locationID)
#'
#' geohashID <- location_createID(lon, lat, algorithm = "geohash")
#' print(geohashID)
#'
#' @references \url{https://en.wikipedia.org/wiki/Decimal_degrees}
#' @references \url{https://www.johndcook.com/blog/2017/01/10/probability-of-secure-hash-collisions/}
#' @rdname location_createID
#' @export
#'
location_createID <- function(
longitude = NULL,
latitude = NULL
latitude = NULL,
algorithm = c("digest", "geohash")
) {
returnVal <- MazamaCoreUtils::createLocationID(longitude, latitude)

returnVal <- MazamaCoreUtils::createLocationID(longitude, latitude, algorithm)
return(returnVal)

}
117 changes: 36 additions & 81 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 179708d

Please sign in to comment.