Skip to content

Commit

Permalink
chore!: more renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle committed Aug 12, 2024
1 parent bb3dfb8 commit 45dc038
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
^EMODnetWFS\.Rproj$
^emodnet.wfs\.Rproj$
^\.Rproj\.user$
^README\.Rmd$
^README\.md$
Expand All @@ -16,5 +16,5 @@
^Meta$
^attic$
^codemeta\.json$
^vignettes/EMODnetWFS\.Rmd\.orig$
^vignettes/emodnet.wfs\.Rmd\.orig$
^\.lintr$
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to EMODnetWFS
# Contributing to emodnet.wfs

This outlines how to propose a change to EMODnetWFS.
This outlines how to propose a change to emodnet.wfs.

## Fixing typos

Expand All @@ -16,7 +16,7 @@ If you’ve found a bug, please file an issue that illustrates the bug with a mi

### Pull request process

* Fork the package and clone onto your computer. If you haven't done this before, we recommend using `usethis::create_from_github("EMODnet/EMODnetWFS", fork = TRUE)`.
* Fork the package and clone onto your computer. If you haven't done this before, we recommend using `usethis::create_from_github("EMODnet/emodnet.wfs", fork = TRUE)`.

* Install all development dependencies with `pak::pak()`, and then make sure the package passes R CMD check by running `devtools::check()`.
If R CMD check doesn't pass cleanly, it's a good idea to ask for help before continuing.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Test-Services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ jobs:
run: |
options(crayon.enabled = TRUE)
install.packages(".", repos = NULL, type="source")
test_service <- lapply(EMODnetWFS::emodnet_wfs()$service_name, EMODnetWFS::emodnet_init_wfs_client);
test_service <- lapply(emodnet.wfs::emodnet_wfs()$service_name, emodnet.wfs::emodnet_init_wfs_client);
testthat::test_that("All services work", {testthat::expect_equal(class(test_service), "list")})
shell: Rscript {0}
8 changes: 4 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# EMODnetWFS (development version)
# emodnet.wfs (development version)

* Added ability to pass vendor parameter to `EMODnetWFS::emodnet_get_layers()` queries (#88).
* Added ability to pass vendor parameter to `emodnet.wfs::emodnet_get_layers()` queries (#88).
* Added memoising (caching during each R session) of the functions getting services
and layers information (#52).

# EMODnetWFS 2.0.1
# emodnet.wfs 2.0.1

* Introduced better handling of server response errors.

# EMODnetWFS 2.0.0
# emodnet.wfs 2.0.0


* NEW FEATURE: Added `ecql` filtering capability and ability to interrogate feature attribute (see relevant vignette).
Expand Down
12 changes: 6 additions & 6 deletions R/emodnet.wfs-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
NULL

emodnetwfs_collaborators <- function() {
readLines(system.file("collaborators.txt", package = "EMODnetWFS"))
readLines(system.file("collaborators.txt", package = "emodnet.wfs"))
}

emodnetwfs_user_agent <- function() {
version <- as.character(utils::packageVersion("EMODnetWFS"))
version <- as.character(utils::packageVersion("emodnet.wfs"))

if (nzchar(Sys.getenv("EMODNETWFS_CI"))) {
return(
sprintf(
"EMODnetWFS R package %s CI https://github.com/EMODnet/EMODnetWFS",
"emodnet.wfs R package %s CI https://github.com/EMODnet/emodnet.wfs",
version
)
)
Expand All @@ -28,20 +28,20 @@ emodnetwfs_user_agent <- function() {
gh_username %in% emodnetwfs_collaborators()) {
return(
sprintf(
"EMODnetWFS R package %s DEV https://github.com/EMODnet/EMODnetWFS",
"emodnet.wfs R package %s DEV https://github.com/EMODnet/emodnet.wfs",
version
)
)
}

sprintf(
"EMODnetWFS R package %s https://github.com/EMODnet/EMODnetWFS",
"emodnet.wfs R package %s https://github.com/EMODnet/emodnet.wfs",
version
)
}

globalVariables(c("layer_name", "n"))

release_bullets <- function() { # nocov start
c('update vignette with knitr::knit("vignettes/EMODnetWFS.Rmd.orig", output = "vignettes/EMODnetWFS.Rmd")') # nolint: line_length_linter
c('update vignette with knitr::knit("vignettes/emodnet.wfs.Rmd.orig", output = "vignettes/emodnet.wfs.Rmd")') # nolint: line_length_linter
} # nocov end
2 changes: 1 addition & 1 deletion R/emodnet_wfs.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.emodnet_wfs <- function() {
utils::read.csv(
system.file("services.csv", package = "EMODnetWFS"),
system.file("services.csv", package = "emodnet.wfs"),
stringsAsFactors = FALSE
)
}
Expand Down
4 changes: 2 additions & 2 deletions R/layers.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
#' `"biology_occurrence_data"` service),
#' you might consider a combination of these ideas:
#' - using [`outputFormat = "CSV"`](https://docs.geoserver.org/stable/en/user/services/wfs/reference.html#getfeature);
#' - filtering using [`cql_filters`](https://emodnet.github.io/EMODnetWFS/articles/ecql_filtering.html) or
#' [bounding boxes](https://emodnet.github.io/EMODnetWFS/articles/request-params.html#limit-spatial-extent-using-a-boundary-box)
#' - filtering using [`cql_filters`](https://emodnet.github.io/emodnet.wfs/articles/ecql_filtering.html) or
#' [bounding boxes](https://emodnet.github.io/emodnet.wfs/articles/request-params.html#limit-spatial-extent-using-a-boundary-box)
#' (possibly splitting the area of interests into several requests);
#' - Using [EMODnet's download toolbox](https://emodnet.ec.europa.eu/geoviewer/).
# nolint end
Expand Down
6 changes: 3 additions & 3 deletions R/ui.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
cli_alert_success <- function(text, .envir = parent.frame()) {
if (!getOption("EMODnetWFS.quiet", FALSE)) {
if (!getOption("emodnet.wfs.quiet", FALSE)) {
cli::cli_alert_success(text, .envir = .envir)
}
}

cli_alert_info <- function(text, .envir = parent.frame()) {
if (!getOption("EMODnetWFS.quiet", FALSE)) {
if (!getOption("emodnet.wfs.quiet", FALSE)) {
cli::cli_alert_info(text, .envir = .envir)
}
}

cli_alert_danger <- function(text, .envir = parent.frame()) {
if (!getOption("EMODnetWFS.quiet", FALSE)) {
if (!getOption("emodnet.wfs.quiet", FALSE)) {
cli::cli_alert_danger(text, .envir = .envir)
}
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,22 +460,22 @@ To cite emodnet.wfs, please use the output from
citation(package = "emodnet.wfs")
#> To cite package 'emodnet.wfs' in publications use:
#>
#> Krystalli A, Fernández-Bejarano S, Salmon M (????). _EMODnetWFS:
#> Krystalli A, Fernández-Bejarano S, Salmon M (????). _emodnet.wfs:
#> Access EMODnet Web Feature Service data through R_. R package version
#> 2.0.1.9001. Integrated data products created under the European
#> Marine Observation Data Network (EMODnet) Biology project
#> (EASME/EMFF/2017/1.3.1.2/02/SI2.789013), funded by the by the
#> European Union under Regulation (EU) No 508/2014 of the European
#> Parliament and of the Council of 15 May 2014 on the European Maritime
#> and Fisheries Fund, <https://github.com/EMODnet/EMODnetWFS>.
#> and Fisheries Fund, <https://github.com/EMODnet/emodnet.wfs>.
#>
#> A BibTeX entry for LaTeX users is
#>
#> @Manual{,
#> title = {{EMODnetWFS}: Access EMODnet Web Feature Service data through R},
#> title = {{emodnet.wfs}: Access EMODnet Web Feature Service data through R},
#> author = {Anna Krystalli and Salvador Fernández-Bejarano and Maëlle Salmon},
#> note = {R package version 2.0.1.9001. Integrated data products created under the European Marine Observation Data Network (EMODnet) Biology project (EASME/EMFF/2017/1.3.1.2/02/SI2.789013), funded by the by the European Union under Regulation (EU) No 508/2014 of the European Parliament and of the Council of 15 May 2014 on the European Maritime and Fisheries Fund},
#> url = {https://github.com/EMODnet/EMODnetWFS},
#> url = {https://github.com/EMODnet/emodnet.wfs},
#> }
```

Expand Down
4 changes: 2 additions & 2 deletions man/emodnet_get_layers.Rd

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

2 changes: 1 addition & 1 deletion pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url: "https://emodnet.github.io/EMODnetWFS/"
url: "https://emodnet.github.io/emodnet.wfs/"

home:
title: Access EMODnet Web Feature Service data through R
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library(testthat) # nolint: undesirable_function_linter
library(EMODnetWFS) # nolint: undesirable_function_linter
library(emodnet.wfs) # nolint: undesirable_function_linter

test_check("EMODnetWFS")
test_check("emodnet.wfs")
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/deprecate-service-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
deprecate_msg_service_version("1.1", "blop")
Condition
Warning:
The `service_version` argument of `blop()` is deprecated as of EMODnetWFS 2.0.1.
The `service_version` argument of `blop()` is deprecated as of emodnet.wfs 2.0.1.
i All calls are made with service version 2.0.0. For more control, consider using {ows4r} directly.

2 changes: 1 addition & 1 deletion tests/testthat/setup.R
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pre_test_options <- options(EMODnetWFS.quiet = TRUE)# nolint: undesirable_function_linter
pre_test_options <- options(emodnet.wfs.quiet = TRUE)# nolint: undesirable_function_linter
12 changes: 6 additions & 6 deletions tests/testthat/test-ui.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
test_that("cli_alert_success() works", {
withr::local_options(EMODnetWFS.quiet = TRUE)
withr::local_options(emodnet.wfs.quiet = TRUE)
expect_silent(cli_alert_success("hihihi"))
withr::local_options(EMODnetWFS.quiet = FALSE)
withr::local_options(emodnet.wfs.quiet = FALSE)
expect_snapshot(cli_alert_success("hihihi"))
})

test_that("cli_alert_info() works", {
withr::local_options(EMODnetWFS.quiet = TRUE)
withr::local_options(emodnet.wfs.quiet = TRUE)
expect_silent(cli_alert_info("hihihi"))
withr::local_options(EMODnetWFS.quiet = FALSE)
withr::local_options(emodnet.wfs.quiet = FALSE)
expect_snapshot(cli_alert_info("hihihi"))
})

test_that("cli_alert_danger() works", {
withr::local_options(EMODnetWFS.quiet = TRUE)
withr::local_options(emodnet.wfs.quiet = TRUE)
expect_silent(cli_alert_danger("hihihi"))
withr::local_options(EMODnetWFS.quiet = FALSE)
withr::local_options(emodnet.wfs.quiet = FALSE)
expect_snapshot(cli_alert_danger("hihihi"))
})
6 changes: 3 additions & 3 deletions vignettes/articles/ecql_filtering.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ knitr::opts_chunk$set(
```


So far, we've demonstrated using `EMODnetWFS` to request complete layers.
So far, we've demonstrated using emodnet.wfs to request complete layers.

However, WFS services allows us to be selective with what features are returned from the EMODnet servers.
For example: using [CQL filters](https://docs.geoserver.org/stable/en/user/tutorials/cql/cql_tutorial.html), we can send a query including a filtering clause that will be executed on the server and return only the subset of the information we request.
Expand Down Expand Up @@ -48,7 +48,7 @@ The examples provided here are only a small subset of filtering functionality av
First, let's load the library and start a new WFS client with `emodnet_init_wfs_client`.

```{r setup}
library(EMODnetWFS)
library(emodnet.wfs)
```


Expand Down Expand Up @@ -327,6 +327,6 @@ unique(filter_sf3$country)

### Advanced use

There is more that can accomplished by using the EMODnet WFS services than downloading data. The EMODnetWFS package is built on top of the [ows4R](https://github.com/eblondel/ows4R) library, meaning that all the functionalities of this package are available for EMODnetWFS. The ows4R returns a special type of R object called R6. You can learn more in Hadley Wickham's chapter on R6 Objects of the [Advance R book](https://adv-r.hadley.nz/r6.html).
There is more that can accomplished by using the EMODnet WFS services than downloading data. The emodnet.wfs package is built on top of the [ows4R](https://github.com/eblondel/ows4R) library, meaning that all the functionalities of this package are available for emodnet.wfs. The ows4R returns a special type of R object called R6. You can learn more in Hadley Wickham's chapter on R6 Objects of the [Advance R book](https://adv-r.hadley.nz/r6.html).

For instance: it is not efficient to read a large dataset into R just and later subset part of it. This requires longer waiting times and more bandwidth usage, and in very large datasets it would simply not be possible. For instance, all the occurrences data available through the EMODnet Biology portal are stored in [one table](https://www.emodnet-biology.eu/emodnet-data-format): These are approximately 30 millions rows! In this case, we suggest you access the EMODnet Biology occurrence data through the [download toolbox](https://www.emodnet-biology.eu/toolbox/) or the [eurobis R package](https://github.com/lifewatch/eurobis/) instead.
6 changes: 3 additions & 3 deletions vignettes/articles/request-params.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ knitr::opts_chunk$set(

## Initialise a WFS client

Let's start by loading `EMODnetWFS` and initialising a WFS client to the `human_activities` WFS service.
Let's start by loading emodnet.wfs and initialising a WFS client to the `human_activities` WFS service.

```{r setup}
library(EMODnetWFS)
library(emodnet.wfs)
wfs <- emodnet_init_wfs_client("human_activities")
```
Expand Down Expand Up @@ -181,7 +181,7 @@ WFS vendor parameters are additonal, non-standard request parameters defined by

The majority of EMODnet services are GeoServer WFS implementations which support a variety of vendor-specific WFS parameters.

One of these are **`cql_filters`**. These are handled explicitly through the `EMODnetWFS` package through the `cql_filter` argument in `emodnet_get_layers()` and are documented in detail in `article("ecql_filtering")`.
One of these are **`cql_filters`**. These are handled explicitly through the emodnet.wfs package through the `cql_filter` argument in `emodnet_get_layers()` and are documented in detail in `article("ecql_filtering")`.

For additional vendor parameters available through GeoServer implementations please refer to the [WFS vendor parameters documentatio](https://docs.geoserver.org/latest/en/user/services/wfs/vendor.html)

Expand Down
File renamed without changes
File renamed without changes
14 changes: 7 additions & 7 deletions vignettes/EMODnetWFS.Rmd → vignettes/emodnet.wfs.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "EMODnetWFS Case Study: Accessing and mapping EMODnet data"
title: "emodnet.wfs Case Study: Accessing and mapping EMODnet data"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{API details}
Expand All @@ -17,11 +17,11 @@ The package was designed to make EMODnet vector data layers easily accessible in
## Data Product
### Installation

You can install the development version of `EMODnetWFS` from GitHub with:
You can install the development version of emodnet.wfs from GitHub with:


``` r
remotes::install_github("EMODnet/EMODnetWFS")
pak::pak("EMODnet/emodnet.wfs")
```

### Explore the EMODnet WFS services with R
Expand All @@ -37,13 +37,13 @@ install.packages(c("sf", "dplyr", "mapview"))



With the `EMODnetWFS` package, we can explore and combine the data served by the [EMODnet lots ](https://www.emodnet.eu/en/portals) through [OGC Web Feature Services](https://en.wikipedia.org/wiki/Web_Feature_Service) or WFS.
With the emodnet.wfs package, we can explore and combine the data served by the [EMODnet lots ](https://www.emodnet.eu/en/portals) through [OGC Web Feature Services](https://en.wikipedia.org/wiki/Web_Feature_Service) or WFS.

Imagine we are interested in seabed substrates. The first step is to choose what EMODnet lot can provide with these data. For that, we can check the services available with the `emodnet_wfs()` function.


``` r
library(EMODnetWFS)
library(emodnet.wfs)
library(mapview)
library(dplyr)
library(sf)
Expand Down Expand Up @@ -148,7 +148,7 @@ emodnet_get_layer_info(



We are now ready to read the layers into R with `emodnet_get_layers()`. EMODnetWFS reads the geometries as simple features (See `sf` package) transformed to [4326](https://epsg.io/4326) by default. Specifying another map projection is possible by passing a EPGS code or projection string with `emodnet_get_layers(crs = "your projection")`. The argument `reduce_layers = TRUE` stack all the layers in one single tibble. Default is FALSE and returns a list of sf objects, one per layer.
We are now ready to read the layers into R with `emodnet_get_layers()`. emodnet.wfs reads the geometries as simple features (See `sf` package) transformed to [4326](https://epsg.io/4326) by default. Specifying another map projection is possible by passing a EPGS code or projection string with `emodnet_get_layers(crs = "your projection")`. The argument `reduce_layers = TRUE` stack all the layers in one single tibble. Default is FALSE and returns a list of sf objects, one per layer.


``` r
Expand Down Expand Up @@ -224,4 +224,4 @@ Tim Appelhans, Florian Detsch, Christoph Reudenbach and Stefan Woellauer (2020).

Please cite this package as:

Anna Krystalli (2020). EMODnetWFS: Access EMODnet Web Feature Service data through R. R package version 0.0.2. https://github.com/EMODnet/EMODnetWFS. Integrated data products created under the European Marine Observation Data Network (EMODnet) Biology project (EASME/EMFF/2017/1.3.1.2/02/SI2.789013), funded by the by the European Union under Regulation (EU) No 508/2014 of the European Parliament and of the Council of 15 May 2014 on the European Maritime and Fisheries Fund.
Anna Krystalli (2020). emodnet.wfs: Access EMODnet Web Feature Service data through R. R package version 0.0.2. https://github.com/EMODnet/emodnet.wfs. Integrated data products created under the European Marine Observation Data Network (EMODnet) Biology project (EASME/EMFF/2017/1.3.1.2/02/SI2.789013), funded by the by the European Union under Regulation (EU) No 508/2014 of the European Parliament and of the Council of 15 May 2014 on the European Maritime and Fisheries Fund.
File renamed without changes.

0 comments on commit 45dc038

Please sign in to comment.