Skip to content

Commit

Permalink
Ready for CRAN in February
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Jan 17, 2024
1 parent 5cc5efa commit 9db0aa2
Show file tree
Hide file tree
Showing 17 changed files with 294 additions and 213 deletions.
15 changes: 12 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ references:
email: [email protected]
orcid: https://orcid.org/0000-0002-4035-0289
year: '2024'
identifiers:
- type: url
value: https://arxiv.org/abs/1403.2805
version: '>= 1.7.0'
- type: software
title: lifecycle
Expand Down Expand Up @@ -149,6 +146,18 @@ references:
year: '2024'
institution:
name: R Foundation for Statistical Computing
- type: software
title: arcgeocoder
abstract: 'arcgeocoder: Geocoding with the ''ArcGIS'' REST API Service'
notes: Suggests
url: https://dieghernan.github.io/arcgeocoder/
repository: https://CRAN.R-project.org/package=arcgeocoder
authors:
- family-names: Hernangómez
given-names: Diego
email: [email protected]
orcid: https://orcid.org/0000-0001-8457-4658
year: '2024'
- type: software
title: ggplot2
abstract: 'ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics'
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Imports:
sf (>= 0.9.0),
utils
Suggests:
arcgeocoder,
ggplot2 (>= 3.0.0),
knitr,
rmarkdown,
Expand All @@ -39,7 +40,7 @@ Copyright: Data © OpenStreetMap contributors, ODbL 1.0.
<https://www.openstreetmap.org/copyright>
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.0
X-schema.org-applicationCategory: cartography
X-schema.org-keywords: r, geocoding, openstreetmap, address, nominatim,
reverse-geocoding, rstats, shapefile, r-package, spatial, cran,
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- `geo_amenity()` and `geo_amenity_sf()`, see
[Nominatim/issues/1311](https://github.com/osm-search/Nominatim/issues/1311).
Use `arcgeocoder::arc_geo_categories()` as an alternative.
- `nominatimlite::osm_amenities` data set deleted.

# nominatimlite 0.2.1
Expand Down
28 changes: 19 additions & 9 deletions R/geo_amenity.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' `r lifecycle::badge("deprecated")`
#'
#' This operation is not supported any more. Use
#' [**osmdata**](https://github.com/ropensci/osmdata) instead.
#' [arcgeocoder::arc_geo_categories()] instead.
#'
#'
#' @param bbox A numeric vector of latitude and longitude
Expand All @@ -19,21 +19,30 @@
#'
#' @inheritParams geo_lite
#'
#' @return A \CRANpkg{tibble} with the results.
#' @return An error.
#'
#' @seealso [geo_amenity_sf()]
#' @details
#' @keywords internal
#'
#' Bounding boxes can be located using different online tools, as
#' [Bounding Box Tool](https://boundingbox.klokantech.com/).
#' @export
#' @examples
#' \donttest{
#' #' # Madrid, Spain
#'
#' For a full list of valid amenities see
#' <https://wiki.openstreetmap.org/wiki/Key:amenity>.
#' library(arcgeocoder)
#' library(ggplot2)
#'
#' bbox <- c(-3.888954, 40.311977, -3.517916, 40.643729)
#'
#' @keywords internal
#' # Food
#' rest_pub <- arc_geo_categories(
#' bbox = bbox, category = "Bakery,Bar or Pub",
#' full_results = TRUE,
#' limit = 50
#' )
#'
#' @export
#' rest_pub
#' }
geo_amenity <- function(bbox,
amenity,
lat = "lat",
Expand All @@ -46,6 +55,7 @@ geo_amenity <- function(bbox,
strict = FALSE) {
if (requireNamespace("lifecycle", quietly = TRUE)) {
lifecycle::deprecate_stop("0.3.0", "geo_amenity()",
with = "arcgeocoder::arc_geo_categories()",
details = paste(
"Operation not supported any",
"more by the Nominatim API."
Expand Down
36 changes: 26 additions & 10 deletions R/geo_amenity_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,42 @@
#' `r lifecycle::badge("deprecated")`
#'
#' This operation is not supported any more. Use
#' [**osmdata**](https://github.com/ropensci/osmdata) instead.
#' [arcgeocoder::arc_geo_categories()] instead.
#'
#'
#' @inheritParams geo_lite_sf
#' @inheritParams geo_amenity
#'
#' @return A \CRANpkg{sf} object with the results.
#'
#' @details
#'
#' Bounding boxes can be located using different online tools, as
#' [Bounding Box Tool](https://boundingbox.klokantech.com/).
#'
#' For a full list of valid amenities see
#' <https://wiki.openstreetmap.org/wiki/Key:amenity>.
#' @return An error
#'
#' @inheritSection geo_lite_sf About Geometry Types
#'
#' @keywords internal
#'
#' @export
#' @examples
#' \donttest{
#' #' # Madrid, Spain
#'
#' library(arcgeocoder)
#' library(ggplot2)
#'
#' bbox <- c(-3.888954, 40.311977, -3.517916, 40.643729)
#'
#' # Food
#' rest_pub <- arc_geo_categories(
#' bbox = bbox, category = "Bakery,Bar or Pub",
#' full_results = TRUE,
#' limit = 50
#' )
#' if (nrow(rest_pub) > 1) {
#' # To sf
#' rest_pub_sf <- sf::st_as_sf(rest_pub, coords = c("lon", "lat"), crs = 4326)
#'
#' ggplot(rest_pub_sf) +
#' geom_sf(aes(color = Type))
#' }
#' }
geo_amenity_sf <- function(bbox,
amenity,
limit = 1,
Expand All @@ -36,6 +51,7 @@ geo_amenity_sf <- function(bbox,
strict = FALSE) {
if (requireNamespace("lifecycle", quietly = TRUE)) {
lifecycle::deprecate_stop("0.3.0", "geo_amenity_sf()",
with = "arcgeocoder::arc_geo_categories()",
details = paste(
"Operation not supported any",
"more by the Nominatim API."
Expand Down
16 changes: 14 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.3.2 (2023-10-31)",
"runtimePlatform": "R version 4.3.2 (2023-10-31 ucrt)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -57,6 +57,18 @@
}
],
"softwareSuggestions": [
{
"@type": "SoftwareApplication",
"identifier": "arcgeocoder",
"name": "arcgeocoder",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=arcgeocoder"
},
{
"@type": "SoftwareApplication",
"identifier": "ggplot2",
Expand Down Expand Up @@ -187,7 +199,7 @@
},
"applicationCategory": "cartography",
"keywords": ["r", "geocoding", "openstreetmap", "address", "nominatim", "reverse-geocoding", "rstats", "shapefile", "r-package", "spatial", "cran", "api-wrapper", "api", "gis"],
"fileSize": "246.956KB",
"fileSize": "251.108KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down
2 changes: 1 addition & 1 deletion inst/schemaorg.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"runtimePlatform": "R version 4.3.2 (2023-10-31)",
"runtimePlatform": "R version 4.3.2 (2023-10-31 ucrt)",
"version": "0.2.1.9000"
},
{
Expand Down
Binary file modified man/figures/README-line-object-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-pizzahut-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-statue_liberty-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 19 additions & 7 deletions man/geo_amenity.Rd

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

35 changes: 26 additions & 9 deletions man/geo_amenity_sf.Rd

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

27 changes: 14 additions & 13 deletions revdep/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Platform

|field |value |
|:--------|:---------------------------------------------------------------------|
|version |R version 4.3.2 (2023-10-31 ucrt) |
|os |Windows Server 2022 x64 (build 20348) |
|system |x86_64, mingw32 |
|ui |RTerm |
|language |(EN) |
|collate |English_United States.utf8 |
|ctype |English_United States.utf8 |
|tz |UTC |
|date |2024-01-15 |
|pandoc |2.19.2 @ C:\HOSTED~1\windows\pandoc\219~1.2\x64\PANDOC~1.2\pandoc.exe |
|field |value |
|:--------|:--------------------------------------|
|version |R version 4.3.2 (2023-10-31 ucrt) |
|os |Windows 11 x64 (build 22621) |
|system |x86_64, mingw32 |
|ui |RStudio |
|language |(EN) |
|collate |Spanish_Spain.utf8 |
|ctype |Spanish_Spain.utf8 |
|tz |Europe/Madrid |
|date |2024-01-17 |
|rstudio |2023.12.0+369 Ocean Storm (desktop) |
|pandoc |2.19.2 @ C:\PROGRA~1\Pandoc\pandoc.exe |

# Dependencies

Expand Down Expand Up @@ -42,7 +43,7 @@
|units |0.8-5 |0.8-5 | |
|utf8 |1.2.4 |1.2.4 | |
|vctrs |0.6.5 |0.6.5 | |
|withr |2.5.2 |2.5.2 | |
|withr |3.0.0 |3.0.0 | |
|wk |0.9.1 |0.9.1 | |

# Revdeps
Expand Down
2 changes: 1 addition & 1 deletion revdep/cran.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## revdepcheck results

We checked 1 reverse dependencies (0 from CRAN + 1 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.
We checked 1 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.

* We saw 0 new problems
* We failed to check 0 packages
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/_snaps/geo_amenity.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
Condition
Error:
! `geo_amenity()` was deprecated in nominatimlite 0.3.0 and is now defunct.
i Please use `arcgeocoder::arc_geo_categories()` instead.
i Operation not supported any more by the Nominatim API.

1 change: 1 addition & 0 deletions tests/testthat/_snaps/geo_amenity_sf.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
Condition
Error:
! `geo_amenity_sf()` was deprecated in nominatimlite 0.3.0 and is now defunct.
i Please use `arcgeocoder::arc_geo_categories()` instead.
i Operation not supported any more by the Nominatim API.

Loading

0 comments on commit 9db0aa2

Please sign in to comment.