This outlines how to propose a change to EMODnetWFS.
This outlines how to propose a change to emodnet.wfs.
wfs <- emodnet_init_wfs_client(service = "biology")
#> Loading ISO 19139 XML schemas...
@@ -689,8 +689,8 @@ Using OR
and AND
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 library, meaning that
-all the functionalities of this package are available for EMODnetWFS.
+than downloading data. The emodnet.wfs package is built on top of the 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.
For instance: it is not efficient to read a large dataset into R just
diff --git a/articles/emodnet.wfs.html b/articles/emodnet.wfs.html
new file mode 100644
index 00000000..ec8624e7
--- /dev/null
+++ b/articles/emodnet.wfs.html
@@ -0,0 +1,330 @@
+
+
+
+
+
+
+
+emodnet.wfs Case Study: Accessing and mapping EMODnet data • emodnet.wfs
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Skip to contents
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Introduction
+
+
The package was designed to make EMODnet vector data layers easily
+accessible in R. The package allows users to query information on and
+download data from all available EMODnet
+Web Feature Service (WFS) endpoints directly into their R working
+environment. Data are managed as sf
objects which
+are currently the state-of-the-art in handling of vector spatial data in
+R. The package also allows user to specify the coordinate reference
+system of imported data.
+
+
+
Data Product
+
+
+
Installation
+
+
You can install the development version of emodnet.wfs from GitHub
+with:
+
+pak::pak("EMODnet/emodnet.wfs")
+
+
+
Explore the EMODnet WFS services with R
+
+
For this tutorial we will make use of the sf
,
+dplyr
and mapview
packages. The simple
+features sf
package is a well known standard for dealing
+with geospatial vector data. The package dplyr
is a strong
+library for data manipulation. This package also loads
+magrittr
’s pipe operator %>%
(you could
+also use the base
+pipe), which allows to write pipelines in R. To visualize
+geometries, mapview
will create quick interactive maps.
+
Run this line to install these packages:
+
+
With the emodnet.wfs package, we can explore and combine the data
+served by the EMODnet
+lots through OGC Web Feature
+Services 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.
+
+library(emodnet.wfs)
+library(mapview)
+library(dplyr)
+library(sf)
+
+emodnet_wfs()
+#> service_name
+#> 1 bathymetry
+#> 2 biology
+#> 3 biology_occurrence_data
+#> 4 chemistry_cdi_data_discovery_and_access_service
+#> 5 chemistry_cdi_distribution_observations_per_category_and_region
+#> 6 chemistry_contaminants
+#> 7 chemistry_marine_litter
+#> 8 geology_coastal_behavior
+#> 9 geology_events_and_probabilities
+#> 10 geology_marine_minerals
+#> 11 geology_sea_floor_bedrock
+#> 12 geology_seabed_substrate_maps
+#> 13 geology_submerged_landscapes
+#> 14 human_activities
+#> 15 physics
+#> 16 seabed_habitats_general_datasets_and_products
+#> 17 seabed_habitats_individual_habitat_map_and_model_datasets
+#> service_url
+#> 1 https://ows.emodnet-bathymetry.eu/wfs
+#> 2 https://geo.vliz.be/geoserver/Emodnetbio/wfs
+#> 3 https://geo.vliz.be/geoserver/Dataportal/wfs
+#> 4 https://geo-service.maris.nl/emodnet_chemistry/wfs
+#> 5 https://geo-service.maris.nl/emodnet_chemistry_p36/wfs
+#> 6 https://geoserver.hcmr.gr/geoserver/EMODNET_SHARED/wfs
+#> 7 https://www.ifremer.fr/services/wfs/emodnet_chemistry2
+#> 8 https://drive.emodnet-geology.eu/geoserver/tno/wfs
+#> 9 https://drive.emodnet-geology.eu/geoserver/ispra/wfs
+#> 10 https://drive.emodnet-geology.eu/geoserver/gsi/wfs
+#> 11 https://drive.emodnet-geology.eu/geoserver/bgr/wfs
+#> 12 https://drive.emodnet-geology.eu/geoserver/gtk/wfs
+#> 13 https://drive.emodnet-geology.eu/geoserver/bgs/wfs
+#> 14 https://ows.emodnet-humanactivities.eu/wfs
+#> 15 https://prod-geoserver.emodnet-physics.eu/geoserver/ows
+#> 16 https://ows.emodnet-seabedhabitats.eu/geoserver/emodnet_open/wfs
+#> 17 https://ows.emodnet-seabedhabitats.eu/geoserver/emodnet_open_maplibrary/wfs
+
The column service_name
shows services available, while
+service_url
has the corresponding base url to perform a WFS
+request. The Seabed portal should have the data we are looking for. A
+WFS client can be created by passing the corresponding
+service_name
to the function
+emodnet_init_wfs_client()
. The layers available to this WFS
+client are consulted with emodnet_get_wfs_info()
.
+
+seabed_wfs_client <- emodnet_init_wfs_client(service = "seabed_habitats_general_datasets_and_products")
+#> Loading ISO 19139 XML schemas...
+#> Loading ISO 19115 codelists...
+#> ✔ WFS client created successfully
+#> ℹ Service: "https://ows.emodnet-seabedhabitats.eu/geoserver/emodnet_open/wfs"
+#> ℹ Version: "2.0.0"
+
+
+emodnet_get_wfs_info(wfs = seabed_wfs_client)
+#> # A tibble: 71 × 9
+#> # Rowwise:
+#> data_source service_name service_url layer_name title
+#> <chr> <chr> <chr> <chr> <chr>
+#> 1 emodnet_wfs seabed_habitats_ge… https://ow… art17_hab… 2013…
+#> 2 emodnet_wfs seabed_habitats_ge… https://ow… art17_hab… 2013…
+#> 3 emodnet_wfs seabed_habitats_ge… https://ow… art17_hab… 2013…
+#> 4 emodnet_wfs seabed_habitats_ge… https://ow… art17_hab… 2013…
+#> 5 emodnet_wfs seabed_habitats_ge… https://ow… art17_hab… 2013…
+#> 6 emodnet_wfs seabed_habitats_ge… https://ow… art17_hab… 2013…
+#> 7 emodnet_wfs seabed_habitats_ge… https://ow… art17_hab… 2013…
+#> 8 emodnet_wfs seabed_habitats_ge… https://ow… art17_hab… 2013…
+#> 9 emodnet_wfs seabed_habitats_ge… https://ow… carib_eus… 2023…
+#> 10 emodnet_wfs seabed_habitats_ge… https://ow… biogenic_… Biog…
+#> # ℹ 61 more rows
+#> # ℹ 4 more variables: abstract <chr>, class <chr>,
+#> # format <chr>, layer_namespace <chr>
+
Each layer is explained in the abstract
column. We can
+see several layers with the information provided by the EU member states
+for the Habitats
+Directive 92/43/EEC reporting. We will select the layers about
+coastal lagoons, mudflats and sandbanks with their respective
+layer_name
.
+
+habitats_directive_layer_names <- c("art17_hab_1110", "art17_hab_1140", "art17_hab_1150")
+
+emodnet_get_layer_info(
+ wfs = seabed_wfs_client,
+ layers = habitats_directive_layer_names
+)
+#> # A tibble: 3 × 9
+#> # Rowwise:
+#> data_source service_name service_url layer_name title
+#> <chr> <chr> <chr> <chr> <chr>
+#> 1 emodnet_wfs https://ows.emodnet… seabed_hab… art17_hab… 2013…
+#> 2 emodnet_wfs https://ows.emodnet… seabed_hab… art17_hab… 2013…
+#> 3 emodnet_wfs https://ows.emodnet… seabed_hab… art17_hab… 2013…
+#> # ℹ 4 more variables: abstract <chr>, class <chr>,
+#> # format <chr>, layer_namespace <chr>
+
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 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.
+
+habitats_directive_layers <- emodnet_get_layers(
+ wfs = seabed_wfs_client,
+ layers = habitats_directive_layer_names,
+ reduce_layers = TRUE
+)
+
+class(habitats_directive_layers)
+#> [1] "sf" "data.frame"
+
+
+glimpse(habitats_directive_layers)
+#> Rows: 221
+#> Columns: 9
+#> $ gml_id <chr> "art17_hab_1110.13", "art17_hab_1110.22", "art17_hab_1110.25", "ar…
+#> $ habitat_code <chr> "1110", "1110", "1110", "1110", "1110", "1110", "1110", "1110", "1…
+#> $ ms <chr> "DK", "ES", "ES", "PT", "PT", "PL", "DK", "FR", "UK", "BE", "BE", …
+#> $ region <chr> "ATL", "MAC", "MMAC", "MMAC", "MATL", "MBAL", "MBAL", "MATL", "MAT…
+#> $ cs_ms <chr> "U2+", "U1+", "U1+", "XX", "U1-", "U1-", "U1-", "U1x", "U1x", "U1x…
+#> $ country_code <chr> "Denmark", "Spain", "Spain", "Portugal", "Portugal", "Poland", "De…
+#> $ habitat_code_uri <chr> "http://dd.eionet.europa.eu/vocabulary/art17_2018/habitats/1110", …
+#> $ habitat_description <chr> "Sandbanks which are slightly covered by sea water all the time", …
+#> $ geom <MULTISURFACE [m]> MULTISURFACE (POLYGON ((420..., MULTISURFACE (POLYGON…
+
Run the following code to have a quick look at the layers
+geometries
+
+# Transform to Polygon geometry type from Multisurface
+if (unique(st_geometry_type(habitats_directive_layers)) == "MULTISURFACE") {
+ habitats_directive_layers <- habitats_directive_layers %>%
+ st_cast(to = "GEOMETRYCOLLECTION") %>%
+ st_collection_extract(type = "POLYGON")
+}
+
+# Visualize
+map <- mapview(habitats_directive_layers, zcol = "habitat_description", burst = TRUE)
+
+map
+#> Error in loadNamespace(name): there is no package called 'webshot'
+
EMODnet provides also physics, chemistry, biological or bathymetry
+data. Explore all the layers available with.
+
+
+
+
+
+
+
References
+
+
Blondel, Emmanuel. (2020, May 27). ows4R: R Interface to OGC
+Web-Services (Version 0.1-5). Zenodo. http://doi.org/10.5281/zenodo.3860330
+
Flanders Marine Institute (2019). Maritime Boundaries Geodatabase,
+version 11. Available online at https://www.marineregions.org/. https://doi.org/10.14284/382.
+
Hadley Wickham, Romain François, Lionel Henry and Kirill Müller
+(2020). dplyr: A Grammar of Data Manipulation. R package version
+1.0.2.https://CRAN.R-project.org/package=dplyr
+
Pebesma E (2018). “Simple Features for R: Standardized Support for
+Spatial Vector Data.” The R Journal, 10(1), 439–446. doi:
+10.32614/RJ-2018-009, https://doi.org/10.32614/RJ-2018-009.
+
R Core Team (2020). R: A language and environment for statistical
+computing. R Foundation for Statistical Computing, Vienna, Austria. URL
+https://www.R-project.org/.
+
Tim Appelhans, Florian Detsch, Christoph Reudenbach and Stefan
+Woellauer (2020). mapview: Interactive Viewing of Spatial Data in R. R
+package version 2.9.0. https://CRAN.R-project.org/package=mapview
+
+
+
Code
+
+
Please cite this package as:
+
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.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/articles/index.html b/articles/index.html
index 52edf866..580af81f 100644
--- a/articles/index.html
+++ b/articles/index.html
@@ -1,5 +1,5 @@
-Articles • emodnet.wfs
+Articles • emodnet.wfs
Skip to contents
@@ -19,7 +19,7 @@
Changelog
@@ -42,7 +42,7 @@ All vignettes
- EQCL feature filtering
-
-
- EMODnetWFS Case Study: Accessing and mapping EMODnet data
+ - emodnet.wfs Case Study: Accessing and mapping EMODnet data
-
- Using request parameters to limit query results
-
diff --git a/articles/request-params.html b/articles/request-params.html
index 48c6d005..64b6dc4e 100644
--- a/articles/request-params.html
+++ b/articles/request-params.html
@@ -40,7 +40,7 @@
@@ -94,10 +94,10 @@
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.
-library(EMODnetWFS)
+library(emodnet.wfs)
wfs <- emodnet_init_wfs_client("human_activities")
#> Loading ISO 19139 XML schemas...
@@ -385,9 +385,9 @@
and are documented in detail in
+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
diff --git a/authors.html b/authors.html
index 1f3ba49c..2377e6c9 100644
--- a/authors.html
+++ b/authors.html
@@ -1,5 +1,5 @@
-Authors and Citation • emodnet.wfs
+Authors and Citation • emodnet.wfs
Skip to contents
@@ -19,7 +19,7 @@
-
- Changelog
diff --git a/index.html b/index.html
index b7ba805a..834df67c 100644
--- a/index.html
+++ b/index.html
@@ -19,7 +19,7 @@
-
+
Skip to contents
@@ -43,7 +43,7 @@
@@ -517,22 +517,22 @@
diff --git a/news/index.html b/news/index.html
index a68e1e0a..3f7135de 100644
--- a/news/index.html
+++ b/news/index.html
@@ -1,5 +1,5 @@
-
Changelog • emodnet.wfs
+
Changelog • emodnet.wfs
Skip to contents
@@ -19,7 +19,7 @@
-
- Changelog
@@ -37,7 +37,26 @@
Source: NEWS.md
-