Skip to content

Commit 7b80608

Browse files
authored
Merge pull request #131
2 parents 4c0a4ee + 7d15741 commit 7b80608

11 files changed

+63
-89
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: opencage
33
Title: Geocode with the OpenCage API
4-
Version: 0.2.1.9000
4+
Version: 0.2.2
55
Authors@R: c(
66
person("Daniel", "Possenriede", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6738-9845")),
77
person("Jesse", "Sadler", role = "aut", comment = c(ORCID = "0000-0001-6081-9681")),

NEWS.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# opencage (development version)
1+
# opencage 0.2.2
2+
3+
* Fixed a test that caused an error on CRAN's Solaris (#131).
24

35
# opencage 0.2.1
46

README.Rmd

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ output:
1717

1818
<!-- badges: end -->
1919

20-
Geocode with the [OpenCage](https://opencagedata.com/) API, either from place name to longitude and latitude (forward geocoding) or from longitude and latitude to the name and address of the location (reverse geocoding).
20+
Geocode with the [OpenCage](https://opencagedata.com) API, either from place name to longitude and latitude (forward geocoding) or from longitude and latitude to the name and address of the location (reverse geocoding).
2121

2222
## Installation
2323

@@ -27,7 +27,7 @@ Install the package with:
2727
install.packages("opencage")
2828
```
2929

30-
Or install the development version using [remotes](https://remotes.r-lib.org/) with:
30+
Or install the development version using [remotes](https://remotes.r-lib.org) with:
3131

3232
```{r, eval = FALSE}
3333
remotes::install_github("ropensci/opencage")
@@ -64,14 +64,14 @@ But remember, the vignettes are really great! We have:
6464

6565
## About OpenCage
6666

67-
The [OpenCage](https://opencagedata.com/) API supports forward and reverse geocoding.
67+
The [OpenCage](https://opencagedata.com) API supports forward and reverse geocoding.
6868
Sources of OpenCage are open geospatial data including
69-
[OpenStreetMap](https://www.openstreetmap.org/),
69+
[OpenStreetMap](https://www.openstreetmap.org),
7070
[DataScienceToolkit](https://github.com/petewarden/dstk),
7171
[GeoPlanet](https://en.wikipedia.org/wiki/GeoPlanet),
72-
[Natural Earth Data](https://www.naturalearthdata.com/),
72+
[Natural Earth Data](https://www.naturalearthdata.com),
7373
[libpostal](https://github.com/openvenues/libpostal),
74-
[GeoNames](https://www.geonames.org/), and
74+
[GeoNames](https://www.geonames.org), and
7575
[Flickr's shapefiles](https://code.flickr.net/2009/05/21/flickr-shapefiles-public-dataset-10/) plus a whole lot more besides.
7676
Refer to the current full [list of credits](https://opencagedata.com/credits).
7777

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Peer-Review](https://badges.ropensci.org/36_status.svg)](https://github.com/rope
1919

2020
<!-- badges: end -->
2121

22-
Geocode with the [OpenCage](https://opencagedata.com/) API, either from
22+
Geocode with the [OpenCage](https://opencagedata.com) API, either from
2323
place name to longitude and latitude (forward geocoding) or from
2424
longitude and latitude to the name and address of the location (reverse
2525
geocoding).
@@ -33,7 +33,7 @@ install.packages("opencage")
3333
```
3434

3535
Or install the development version using
36-
[remotes](https://remotes.r-lib.org/) with:
36+
[remotes](https://remotes.r-lib.org) with:
3737

3838
``` r
3939
remotes::install_github("ropensci/opencage")
@@ -86,14 +86,14 @@ But remember, the vignettes are really great! We have:
8686

8787
## About OpenCage
8888

89-
The [OpenCage](https://opencagedata.com/) API supports forward and
89+
The [OpenCage](https://opencagedata.com) API supports forward and
9090
reverse geocoding. Sources of OpenCage are open geospatial data
91-
including [OpenStreetMap](https://www.openstreetmap.org/),
91+
including [OpenStreetMap](https://www.openstreetmap.org),
9292
[DataScienceToolkit](https://github.com/petewarden/dstk),
9393
[GeoPlanet](https://en.wikipedia.org/wiki/GeoPlanet), [Natural Earth
94-
Data](https://www.naturalearthdata.com/),
94+
Data](https://www.naturalearthdata.com),
9595
[libpostal](https://github.com/openvenues/libpostal),
96-
[GeoNames](https://www.geonames.org/), and [Flickr’s
96+
[GeoNames](https://www.geonames.org), and [Flickr’s
9797
shapefiles](https://code.flickr.net/2009/05/21/flickr-shapefiles-public-dataset-10/)
9898
plus a whole lot more besides. Refer to the current full [list of
9999
credits](https://opencagedata.com/credits).

cran-comments.md

+6-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
## Release summary
22

3-
### v0.2.1
4-
* Fixed two URLs, one of which was rejected on the v0.2.0 submission.
5-
6-
### v0.2.0 (unreleased)
7-
* Rewrite of the package, see NEWS.md for details.
8-
* Change of maintainer:
9-
* New Maintainer: Daniel Possenriede <[email protected]>
10-
* Old maintainer: Maëlle Salmon <[email protected]>
3+
### v0.2.2
4+
This patch version fixes a test that caused an error on CRAN's Solaris (<https://github.com/ropensci/opencage/pull/131>, <https://www.r-project.org/nosvn/R.check/r-patched-solaris-x86/opencage-00check.html>).
115

126
## Test environments
13-
* local x86_64-w64-mingw32/x64 install, R 4.0.3
7+
* local x86_64-w64-mingw32/x64, R 4.0.4
148
* GitHub Actions <https://github.com/ropensci/opencage/actions?query=workflow%3AR-CMD-check>:
159
* Ubuntu 20.04, R devel, release and oldrel
1610
* windows-latest, R release
@@ -21,17 +15,14 @@
2115
* Windows Server 2008 R2 SP1, R-devel, 32/64 bit
2216
* win-builder (devel)
2317

24-
## R CMD check results
18+
## R CMD check results (local)
2519

26-
Duration: 2m 1.9s
20+
Duration: 2m 10.8s
2721

2822
> checking CRAN incoming feasibility ... NOTE
2923
Maintainer: 'Daniel Possenriede <[email protected]>'
3024
31-
New maintainer:
32-
Daniel Possenriede <[email protected]>
33-
Old maintainer(s):
34-
Maëlle Salmon <[email protected]>
25+
Days since last update: 4
3526

3627
0 errors √ | 0 warnings √ | 1 note x
3728

revdep/README.md

+18-22
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,27 @@
22

33
|field |value |
44
|:--------|:----------------------------|
5-
|version |R version 4.0.3 (2020-10-10) |
5+
|version |R version 4.0.4 (2021-02-15) |
66
|os |Windows 10 x64 |
77
|system |x86_64, mingw32 |
88
|ui |RStudio |
99
|language |en |
1010
|collate |German_Germany.1252 |
1111
|ctype |German_Germany.1252 |
1212
|tz |Europe/Berlin |
13-
|date |2021-02-11 |
13+
|date |2021-02-18 |
1414

1515
# Dependencies
1616

1717
|package |old |new |<U+0394> |
1818
|:-----------|:------|:------|:--|
19-
|opencage |0.1.4 |0.2.0 |* |
20-
|askpass |1.1 |NA |* |
19+
|opencage |0.2.1 |0.2.2 |* |
2120
|assertthat |0.2.1 |0.2.1 | |
22-
|cachem |1.0.3 |1.0.3 | |
21+
|cachem |1.0.4 |1.0.4 | |
2322
|cli |2.3.0 |2.3.0 | |
24-
|cpp11 |NA |0.2.6 |* |
23+
|cpp11 |0.2.6 |0.2.6 | |
2524
|crayon |1.4.1 |1.4.1 | |
26-
|crul |NA |1.0.0 |* |
25+
|crul |1.1.0 |1.1.0 | |
2726
|curl |4.3 |4.3 | |
2827
|digest |0.6.27 |0.6.27 | |
2928
|dplyr |1.0.4 |1.0.4 | |
@@ -32,33 +31,30 @@
3231
|fastmap |1.1.0 |1.1.0 | |
3332
|generics |0.1.0 |0.1.0 | |
3433
|glue |1.4.2 |1.4.2 | |
35-
|hms |NA |1.0.0 |* |
36-
|httpcode |NA |0.3.0 |* |
37-
|httr |1.4.2 |NA |* |
34+
|hms |1.0.0 |1.0.0 | |
35+
|httpcode |0.3.0 |0.3.0 | |
3836
|jsonlite |1.7.2 |1.7.2 | |
39-
|lifecycle |0.2.0 |0.2.0 | |
37+
|lifecycle |1.0.0 |1.0.0 | |
4038
|magrittr |2.0.1 |2.0.1 | |
4139
|memoise |2.0.0 |2.0.0 | |
42-
|mime |0.9 |0.9 | |
43-
|openssl |1.4.3 |NA |* |
40+
|mime |0.10 |0.10 | |
4441
|pillar |1.4.7 |1.4.7 | |
4542
|pkgconfig |2.0.3 |2.0.3 | |
46-
|prettyunits |NA |1.1.1 |* |
47-
|progress |NA |1.2.2 |* |
43+
|prettyunits |1.1.1 |1.1.1 | |
44+
|progress |1.2.2 |1.2.2 | |
4845
|purrr |0.3.4 |0.3.4 | |
4946
|R6 |2.5.0 |2.5.0 | |
50-
|ratelimitr |NA |0.4.1 |* |
51-
|Rcpp |NA |1.0.6 |* |
47+
|ratelimitr |0.4.1 |0.4.1 | |
48+
|Rcpp |1.0.6 |1.0.6 | |
5249
|rlang |0.4.10 |0.4.10 | |
53-
|sys |3.4 |NA |* |
5450
|tibble |3.0.6 |3.0.6 | |
55-
|tidyr |NA |1.1.2 |* |
51+
|tidyr |1.1.2 |1.1.2 | |
5652
|tidyselect |1.1.0 |1.1.0 | |
57-
|triebeard |NA |0.3.0 |* |
58-
|urltools |NA |1.7.3 |* |
53+
|triebeard |0.3.0 |0.3.0 | |
54+
|urltools |1.7.3 |1.7.3 | |
5955
|utf8 |1.1.4 |1.1.4 | |
6056
|vctrs |0.3.6 |0.3.6 | |
61-
|withr |NA |2.4.1 |* |
57+
|withr |2.4.1 |2.4.1 | |
6258

6359
# Revdeps
6460

tests/testthat/test-oc_config.R

+6-21
Original file line numberDiff line numberDiff line change
@@ -53,35 +53,22 @@ test_that("oc_config throws error with faulty OpenCage key", {
5353

5454
# test rate_sec argument --------------------------------------------------
5555

56-
timer <- function(expr) {
57-
system.time(expr)[["elapsed"]]
58-
}
59-
60-
oc_get_limited_test <- function(reps) {
61-
replicate(
62-
reps,
63-
oc_get_limited("https://httpbin.org/get")
64-
)
65-
}
66-
6756
test_that("oc_config updates rate limit of oc_get_limit", {
68-
skip_if_offline("httpbin.org")
6957
# make sure there is a key present
7058
withr::local_envvar(c("OPENCAGE_KEY" = key_200))
7159

7260
rps <- 5L
7361
oc_config(rate_sec = rps)
74-
t <- timer(oc_get_limited_test(rps + 1))
75-
expect_gt(t, 1)
76-
expect_lt(t, 3)
62+
expect_equal(ratelimitr::get_rates(oc_get_limited)[[1]][["n"]], rps)
7763

7864
rps <- 3L
7965
oc_config(rate_sec = rps)
80-
t <- timer(oc_get_limited_test(rps + 1))
81-
expect_gt(t, 1)
82-
expect_lt(t, 3)
83-
})
66+
expect_equal(ratelimitr::get_rates(oc_get_limited)[[1]][["n"]], rps)
8467

68+
# set rate_sec back to default: 1L/sec
69+
oc_config()
70+
expect_equal(ratelimitr::get_rates(oc_get_limited)[[1]][["n"]], 1L)
71+
})
8572

8673
# test no_record argument -------------------------------------------------
8774

@@ -111,7 +98,6 @@ test_that("oc_config sets no_record option", {
11198
expect_equal(getOption("oc_no_record"), TRUE)
11299
res <- oc_process("Hamburg", return = "url_only")
113100
expect_match(res[[1]], "&no_record=1", fixed = TRUE)
114-
115101
})
116102

117103
# test show_key argument --------------------------------------------------
@@ -128,5 +114,4 @@ test_that("oc_config sets show_key option", {
128114
withr::local_envvar(c("OPENCAGE_KEY" = key_200))
129115
oc_config(show_key = TRUE)
130116
expect_equal(getOption("oc_show_key"), TRUE)
131-
132117
})

vignettes/customise_query.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Customise your query"
33
subtitle: "Get more and better results from OpenCage"
44
author: "Daniel Possenriede, Jesse Sadler, Maëlle Salmon"
5-
date: "2021-02-11"
5+
date: "2021-02-18"
66
description: >
77
"The OpenCage API supports about a dozen parameters to customise a query and here we will explain how to use them."
88
output:

vignettes/opencage.Rmd

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Introduction to opencage"
33
subtitle: "Forward and Reverse Geocoding"
44
author: "Daniel Possenriede, Jesse Sadler, Maëlle Salmon"
5-
date: "2021-02-14"
5+
date: "2021-02-18"
66
description: >
77
"Get started with the opencage R package to geocode with the OpenCage API, either from place name to longitude and latitude (forward geocoding) or from longitude and latitude to the name and address of a location (reverse geocoding)."
88
output:
@@ -46,7 +46,7 @@ There are three safer ways to set your API key instead:
4646
From there it will be fetched by all functions that call the OpenCage API.
4747
You do not even have to call `oc_config()` to set your key;
4848
you can start geocoding right away.
49-
If you have the {[usethis](https://usethis.r-lib.org/)} package installed, you can edit your `.Renviron` with `usethis::edit_r_environ()`.
49+
If you have the {[usethis](https://usethis.r-lib.org)} package installed, you can edit your `.Renviron` with `usethis::edit_r_environ()`.
5050
We strongly recommend storing your API key in the user-level `.Renviron`, as opposed to the project-level.
5151
This makes it less likely you will share sensitive information by mistake.
5252

@@ -66,7 +66,7 @@ If you have a "Free Trial" account with OpenCage, you can skip to the next secti
6666

6767
If you have a paid account, you can set the rate limit for the active R session with `oc_config(rate_sec = n)` where `n` is the appropriate rate limit.
6868
You can set the rate limit persistently across sessions by setting an `oc_rate_sec` option in your `.Rprofile`.
69-
If you have the {[usethis](https://usethis.r-lib.org/)} package installed, you can edit your `.Rprofile` with `usethis::edit_r_profile()`.
69+
If you have the {[usethis](https://usethis.r-lib.org)} package installed, you can edit your `.Rprofile` with `usethis::edit_r_profile()`.
7070

7171
### Privacy
7272

@@ -128,7 +128,7 @@ oc_forward_df(placename = opera)
128128
#> placename oc_lat oc_lng oc_formatted
129129
#> <chr> <dbl> <dbl> <chr>
130130
#> 1 Palacio de Bellas Artes 19.4 -99.1 Palacio de Bellas Artes, Avenida Juárez, Centro Urbano, 06050 Mexico City, Mexico
131-
#> 2 Scala 45.5 9.19 Teatro alla Scala, Via Giuseppe Verdi, 20121 Milan Milan, Italy
131+
#> 2 Scala 45.5 9.19 Teatro alla Scala, Largo Antonio Ghiringhelli, Milan Milan, Italy
132132
#> 3 Sydney Opera House -33.9 151. Sydney Opera House, 2 Macquarie Street, Sydney NSW 2000, Australia
133133
```
134134

@@ -216,11 +216,11 @@ To minimize the number of requests sent to the API {opencage} uses {[memoise](ht
216216
```r
217217
system.time(oc_reverse(latitude = 10, longitude = 10))
218218
#> user system elapsed
219-
#> 0.00 0.00 0.81
219+
#> 0.03 0.00 0.92
220220

221221
system.time(oc_reverse(latitude = 10, longitude = 10))
222222
#> user system elapsed
223-
#> 0 0 0
223+
#> 0.01 0.00 0.02
224224
```
225225

226226
To clear the cache of all results either start a new R session or call `oc_clear_cache()`.
@@ -232,7 +232,7 @@ oc_clear_cache()
232232

233233
system.time(oc_reverse(latitude = 10, longitude = 10))
234234
#> user system elapsed
235-
#> 0.03 0.00 0.74
235+
#> 0.00 0.00 0.92
236236
```
237237

238238
As you probably know, cache invalidation is one of the harder things to do in computer science.
@@ -249,4 +249,4 @@ Besides `oc_forward_df()` and `oc_reverse_df()`, which always return a single ti
249249
Depending on what you specify as the `return` parameter, `oc_forward()` and `oc_reverse()` will return either a list of tibbles (`df_list`, the default), JSON lists (`json_list`), GeoJSON lists (`geojson_list`), or the URL with which the API would be called (`url_only`).
250250
Learn more in the ["Output options"](output_options.html) vignette.
251251

252-
Please report any issues or bugs on [our GitHub repository](https://github.com/ropensci/opencage/issues) and post questions on [discuss.ropensci.org](https://discuss.ropensci.org/).
252+
Please report any issues or bugs on [our GitHub repository](https://github.com/ropensci/opencage/issues) and post questions on [discuss.ropensci.org](https://discuss.ropensci.org).

vignettes/opencage.Rmd.src

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ There are three safer ways to set your API key instead:
5454
From there it will be fetched by all functions that call the OpenCage API.
5555
You do not even have to call `oc_config()` to set your key;
5656
you can start geocoding right away.
57-
If you have the {[usethis](https://usethis.r-lib.org/)} package installed, you can edit your `.Renviron` with `usethis::edit_r_environ()`.
57+
If you have the {[usethis](https://usethis.r-lib.org)} package installed, you can edit your `.Renviron` with `usethis::edit_r_environ()`.
5858
We strongly recommend storing your API key in the user-level `.Renviron`, as opposed to the project-level.
5959
This makes it less likely you will share sensitive information by mistake.
6060

@@ -74,7 +74,7 @@ If you have a "Free Trial" account with OpenCage, you can skip to the next secti
7474

7575
If you have a paid account, you can set the rate limit for the active R session with `oc_config(rate_sec = n)` where `n` is the appropriate rate limit.
7676
You can set the rate limit persistently across sessions by setting an `oc_rate_sec` option in your `.Rprofile`.
77-
If you have the {[usethis](https://usethis.r-lib.org/)} package installed, you can edit your `.Rprofile` with `usethis::edit_r_profile()`.
77+
If you have the {[usethis](https://usethis.r-lib.org)} package installed, you can edit your `.Rprofile` with `usethis::edit_r_profile()`.
7878

7979
### Privacy
8080

@@ -210,4 +210,4 @@ Besides `oc_forward_df()` and `oc_reverse_df()`, which always return a single ti
210210
Depending on what you specify as the `return` parameter, `oc_forward()` and `oc_reverse()` will return either a list of tibbles (`df_list`, the default), JSON lists (`json_list`), GeoJSON lists (`geojson_list`), or the URL with which the API would be called (`url_only`).
211211
Learn more in the ["Output options"](output_options.html) vignette.
212212

213-
Please report any issues or bugs on [our GitHub repository](https://github.com/ropensci/opencage/issues) and post questions on [discuss.ropensci.org](https://discuss.ropensci.org/).
213+
Please report any issues or bugs on [our GitHub repository](https://github.com/ropensci/opencage/issues) and post questions on [discuss.ropensci.org](https://discuss.ropensci.org).

0 commit comments

Comments
 (0)