Skip to content

Commit

Permalink
Merge pull request #11 from GIScience/dev-0.2.1
Browse files Browse the repository at this point in the history
CRAN resubmission
  • Loading branch information
ofr1tz authored Feb 21, 2023
2 parents f21997b + 005878d commit f082c19
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 32 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ohsome
Title: An 'ohsome API' Client
Version: 0.2.0
Version: 0.2.1
Authors@R: c(
person("Heidelberg Institute for Geoinformation Technology (HeiGIT) gGmbH", role = "cph"),
person("Oliver", "Fritz", , "[email protected]", role = c("aut", "cre"),
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# ohsome 0.2.1

* Package CITATION file calls `bibentry()` instead of old-style `citEntry()`.
* Fixed incomplete file URIs in docs.
* Fixed missing `strict = FALSE` in query example in `README`.


# ohsome 0.2.0

* Added a `NEWS.md` file to track changes to the package.
Expand Down
2 changes: 1 addition & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ NULL
#' underlying OSHDB data
#' * `replicationSequenceNumber`: numeric; precise state of the OSM data
#' contained in the underlying OSHDB, expressed as the id of the last
#' applied (hourly) diff file from [Planet OSM](planet.openstreetmap.org)
#' applied (hourly) diff file from [Planet OSM](https://planet.openstreetmap.org)
NULL

#' @docType data
Expand Down
2 changes: 1 addition & 1 deletion R/ohsome_get_metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#' underlying OSHDB
#' * `replicationSequenceNumber`: numeric; precise state of the OSM data
#' contained in the underlying OSHDB, expressed as the id of the last
#' applied (hourly) diff file from [Planet OSM](planet.openstreetmap.org)
#' applied (hourly) diff file from [Planet OSM](https://planet.openstreetmap.org)
#' @seealso [ohsome API Endpoints -- Metadata](https://docs.ohsome.org/ohsome-api/v1/endpoints.html#metadata)
#' @export
#' @examples
Expand Down
10 changes: 6 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ knitr::opts_chunk$set(
# ohsome: An R package to interact with the ohsome API for OpenStreetMap history data aggregation and extraction

<!-- badges: start -->
[![LICENSE](https://img.shields.io/github/license/GIScience/ohsome-r)](LICENSE.md)
[![LICENSE](https://img.shields.io/github/license/GIScience/ohsome-r)](https://github.com/GIScience/ohsome-r/blob/main/LICENSE.md)
[![status: active](https://github.com/GIScience/badges/raw/master/status/active.svg)](https://github.com/GIScience/badges#active)
![CRAN status](https://www.r-pkg.org/badges/version-ago/ohsome)
<!--![CRAN status](https://www.r-pkg.org/badges/version-ago/ohsome)-->
<!-- badges: end -->

This ohsome R package grants access to the power of the [ohsome API](https://api.ohsome.org){target=blank}
Expand Down Expand Up @@ -105,12 +105,14 @@ The resulting `ohsome_query` object can be sent to the ohsome API with
response. In this case, this is a simple `data.frame` of only one row.

```{r post}
ohsome_post(q)
ohsome_post(q, strict = FALSE)
```

The `ohsome_query` object was created without an explicit `time` parameter. When
using functions to create element aggregation queries, `time` defaults to the
most recent available timestamp in the underlying OSHDB.
most recent available timestamp in the underlying OSHDB.^[`ohsome_post` fails on
queries created with an undefined `time` parameter unless strict query
validation is disabled with `strict = FALSE`.]

Defining the `time` parameter unlocks the full power of ohsome API by giving
access to the OSM history. It requires one or more
Expand Down
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

<!-- badges: start -->

[![LICENSE](https://img.shields.io/github/license/GIScience/ohsome-r)](LICENSE.md)
[![LICENSE](https://img.shields.io/github/license/GIScience/ohsome-r)](https://github.com/GIScience/ohsome-r/blob/main/LICENSE.md)
[![status:
active](https://github.com/GIScience/badges/raw/master/status/active.svg)](https://github.com/GIScience/badges#active)
![CRAN status](https://www.r-pkg.org/badges/version-ago/ohsome)
<!--![CRAN status](https://www.r-pkg.org/badges/version-ago/ohsome)-->
<!-- badges: end -->

This ohsome R package grants access to the power of the
Expand Down Expand Up @@ -53,7 +53,7 @@ OSHDB:
library(ohsome)
#> Data: © OpenStreetMap contributors https://ohsome.org/copyrights
#> ohsome API version: 1.8.0
#> Temporal extent: 2007-10-08T00:00:00Z to 2023-01-16T10:00Z
#> Temporal extent: 2007-10-08T00:00:00Z to 2023-02-13T21:00Z
```

The metadata is stored in `ohsome_metadata`. You can print it to the
Expand Down Expand Up @@ -99,15 +99,17 @@ The resulting `ohsome_query` object can be sent to the ohsome API with
response. In this case, this is a simple `data.frame` of only one row.

``` r
ohsome_post(q)
ohsome_post(q, strict = FALSE)
#> Warning: The time parameter is not defined and defaults to the latest available timestamp within the underlying OSHDB.
#> You can use set_time() to set the time parameter.
#> timestamp value
#> 1 2023-01-16 10:00:00 152
#> 1 2023-02-13 21:00:00 153
```

The `ohsome_query` object was created without an explicit `time`
parameter. When using functions to create element aggregation queries,
`time` defaults to the most recent available timestamp in the underlying
OSHDB.
OSHDB.[^1]

Defining the `time` parameter unlocks the full power of ohsome API by
giving access to the OSM history. It requires one or more
Expand All @@ -121,7 +123,7 @@ ohsome_elements_count(franconia, filter = "craft=brewery", time = "2010/2020/P1M
```

Alternatively, we can update the existing `ohsome_query` object `q` with
the `set_time()` function, pipe [^1] the modified query directly into
the `set_time()` function, pipe [^2] the modified query directly into
`ohsome_post()` and make a quick visualization with `ggplot2`:

``` r
Expand Down Expand Up @@ -149,7 +151,7 @@ of an API request. In this case, we could append `groupBy/boundary` to
the existing query to the `elements/count` endpoint. The endpoint path
can either be given as a single string (`/groupBy/boundary`) or as a
character vector:
`set_endpoint(q, c("groupBy", "boundary"), append = TRUE)` [^2].
`set_endpoint(q, c("groupBy", "boundary"), append = TRUE)` [^3].

More comfortable, however, is the use of either the grouping argument
with an elements aggregation function (e.g. 
Expand Down Expand Up @@ -599,7 +601,11 @@ information provided through `citation("ohsome")`.

------------------------------------------------------------------------

[^1]: Instead of the new R native pipe `|>` you may choose to use
[^1]: `ohsome_post` fails on queries created with an undefined `time`
parameter unless strict query validation is disabled with
`strict = FALSE`.

[^2]: Instead of the new R native pipe `|>` you may choose to use
`magrittr`’s `%>%`.

[^2]: The order of the elements in the character vector is critical!
[^3]: The order of the elements in the character vector is critical!
9 changes: 9 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## Resubmission

This is a resubmission. This patch contains the following changes:

- The package CITATION file calls `bibentry()` instead of old-style `citEntry()`
- Fixed incomplete file URIs in `man/ohsome_get_metadata.Rd`,
`man/ohsome_metadata.Rd` and `README.md`.


## Test environments
- R-hub windows-x86_64-devel (r-devel)
- R-hub ubuntu-gcc-release (r-release)
Expand Down
16 changes: 6 additions & 10 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
citEntry(
entry = "Misc",
bibentry(
bibtype = "Misc",
title = "OSHDB - OpenStreetMap History Data Analysis (0.7.2)",
author = c(
person(given = "Martin", family = "Raifer"),
Expand All @@ -12,13 +12,11 @@ citEntry(
publisher = "Zenodo",
version = "0.7.2",
doi = "10.5281/zenodo.5512545",
url = "https://doi.org/10.5281/zenodo.5512545",
header = "When using the OSHDB indirectly through ohsome for a publication, please cite it as:",
textVersion = "Raifer, Martin, Troilo, Rafael, Mocnik, Franz-Benjamin, & Schott, Moritz. (2021). OSHDB - OpenStreetMap History Data Analysis (0.7.2). Zenodo. https://doi.org/10.5281/zenodo.5512545"
header = "When using the OSHDB indirectly through ohsome for a publication, please cite it as:"
)

citEntry(
entry = "Article",
bibentry(
bibtype = "Article",
title = "OSHDB: a framework for spatio-temporal analysis of OpenStreetMap history data",
author = c(
person(given = "Martin", family = "Raifer"),
Expand All @@ -40,7 +38,5 @@ citEntry(
number = 1,
pages = 3,
doi = "10.1186/s40965-019-0061-3",
url = "https://doi.org/10.1186/s40965-019-0061-3",
header = "For scientific papers or similar publications around the analysis of OSM history data, please consider to additionally cite the technical paper describing the OSHDB:",
textVersion = "Raifer, Martin, Troilo, Rafael, Kowatsch, Auer, Michael, Loos, Lukas, Marx, Sabrina, Przybill, Katharina, Fendrich, Sascha, Mocnik, Franz-Benjamin, & Zipf, Alexander. (2019). OSHDB: a framework for spatio-temporal analysis of OpenStreetMap history data. Open geospatial data, softw. stand. 4, 3. https://doi.org/10.1186/s40965-019-0061-3"
header = "For scientific papers or similar publications around the analysis of OSM history data, please consider to additionally cite the technical paper describing the OSHDB:"
)
4 changes: 1 addition & 3 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ OSHDB
OSM
OpenStreetMap
POSIXct
Schweinfurt
URIs
WGS
bboxes
bcircles
Expand All @@ -31,8 +31,6 @@ nominatimlite
rgeoboundaries
rnaturalearth
sfc
spatialExtent
temporalExtent
tidyr
timeframe
timespan
Expand Down
2 changes: 1 addition & 1 deletion man/ohsome_get_metadata.Rd

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

2 changes: 1 addition & 1 deletion man/ohsome_metadata.Rd

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

0 comments on commit f082c19

Please sign in to comment.