From 8b658046448a36cba1e6b8ffa7f81d08cff3c5ad Mon Sep 17 00:00:00 2001 From: hansvancalster Date: Wed, 16 Oct 2024 13:24:19 +0200 Subject: [PATCH 01/13] bump version --- .zenodo.json | 10 +++++----- CITATION.cff | 11 ++++------- DESCRIPTION | 2 +- NEWS.md | 2 ++ inst/CITATION | 6 +++--- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index 618d058..8912b72 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,9 +1,9 @@ { "title": "inbospatial: A Collection of Useful R Functions for Spatial Data", - "version": "0.0.2", + "version": "0.0.3", "license": "MIT", "upload_type": "software", - "description": "

Useful R functions developed at the Research Institute for Nature and\nForest (INBO) for dealing with spatial raster or vector data.<\/p>", + "description": "

Useful R functions developed at the Research Institute for Nature and Forest (INBO) for dealing with spatial raster or vector data.<\/p>", "keywords": [ "spatial", "geospatial", @@ -19,17 +19,17 @@ "name": "Van Calster, Hans", "affiliation": "Research Institute for Nature and Forest (INBO)", "orcid": "0000-0001-8595-8426", - "type": "ContactPerson" + "type": "contactperson" }, { "name": "Vanderhaeghe, Floris", "affiliation": "Research Institute for Nature and Forest (INBO)", "orcid": "0000-0002-6378-6229", - "type": "ProjectMember" + "type": "projectmember" }, { "name": "Research Institute for Nature and Forest (INBO)", - "type": "RightsHolder" + "type": "rightsholder" } ], "creators": [ diff --git a/CITATION.cff b/CITATION.cff index d3331fa..0c0676b 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,6 +1,6 @@ cff-version: 1.2.0 message: If you use this software, please cite it using these metadata. -title: 'inbospatial: A Collection of Useful R Functions for Spatial Data' +title: "inbospatial: A Collection of Useful R Functions for Spatial Data" authors: - given-names: Hans family-names: Van Calster @@ -22,9 +22,6 @@ doi: ~ license: MIT repository-code: https://github.com/inbo/inbospatial/ type: software -abstract: Useful R functions developed at the Research Institute for Nature and Forest - (INBO) for dealing with spatial raster or vector data. -identifiers: -- type: url - value: [] -version: 0.0.2 +abstract: "Useful R functions developed at the Research Institute for Nature and Forest + (INBO) for dealing with spatial raster or vector data." +version: 0.0.3 diff --git a/DESCRIPTION b/DESCRIPTION index 1519db8..1d1572c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: inbospatial Title: A Collection of Useful R Functions for Spatial Data -Version: 0.0.2 +Version: 0.0.3 Authors@R: c( person("Hans", "Van Calster", , "hans.vancalster@inbo.be", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8595-8426", affiliation = "Research Institute for Nature and Forest (INBO)")), diff --git a/NEWS.md b/NEWS.md index 3ff5932..34de59d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# inbospatial 0.0.3 + # inbospatial 0.0.2 ## New functions diff --git a/inst/CITATION b/inst/CITATION index 2270789..ccd7357 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -2,12 +2,12 @@ citHeader("To cite `inbospatial` in publications please use:") # begin checklist entry bibentry( bibtype = "Manual", - title = "inbospatial: A Collection of Useful R Functions for Spatial Data. Version 0.0.2", + title = "inbospatial: A Collection of Useful R Functions for Spatial Data. Version 0.0.3", author = c( author = c(person(given = "Hans", family = "Van Calster"))), - year = 2023, + year = 2024, url = "https://github.com/inbo/inbospatial/", abstract = "Useful R functions developed at the Research Institute for Nature and Forest (INBO) for dealing with spatial raster or vector data.", - textVersion = "Van Calster, Hans (2023) inbospatial: A Collection of Useful R Functions for Spatial Data. Version 0.0.2. https://github.com/inbo/inbospatial/", + textVersion = "Van Calster, Hans (2024) inbospatial: A Collection of Useful R Functions for Spatial Data. Version 0.0.3. https://github.com/inbo/inbospatial/", keywords = "spatial; geospatial; utilities; GIS; raster; vector", ) # end checklist entry From 7eb5f8df43288d0b589eefe6630bfe364e631d2b Mon Sep 17 00:00:00 2001 From: hansvancalster Date: Wed, 16 Oct 2024 13:30:13 +0200 Subject: [PATCH 02/13] update documentation --- DESCRIPTION | 2 +- NAMESPACE | 1 + R/get_feature_wfs.R | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1d1572c..1be8b94 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -41,4 +41,4 @@ Config/checklist/keywords: spatial; geospatial; utilities; GIS; raster; Encoding: UTF-8 Language: en-GB Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 diff --git a/NAMESPACE b/NAMESPACE index 36ad571..ccaae59 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,5 +1,6 @@ # Generated by roxygen2: do not edit by hand +S3method(store_as_gml,raw) export(add_wms_be_cartoweb) export(add_wms_be_ortho) export(add_wms_fl_agriculture) diff --git a/R/get_feature_wfs.R b/R/get_feature_wfs.R index 131dfcd..06d2b7c 100644 --- a/R/get_feature_wfs.R +++ b/R/get_feature_wfs.R @@ -187,6 +187,7 @@ store_as_gml <- function(content, ...) { UseMethod("store_as_gml", content) } +#' @export store_as_gml.raw <- function( content, destfile = tempfile(fileext = "gml"), ...) { writeBin(content, destfile, useBytes = TRUE) From dd261cd6e85fb019380b7eb8b9017d7377d35bfb Mon Sep 17 00:00:00 2001 From: hansvancalster Date: Wed, 16 Oct 2024 16:37:50 +0200 Subject: [PATCH 03/13] fix vignette (issue #13) --- vignettes/wfs_wcs.Rmd | 47 ++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/vignettes/wfs_wcs.Rmd b/vignettes/wfs_wcs.Rmd index 3c05e1d..eec34cf 100644 --- a/vignettes/wfs_wcs.Rmd +++ b/vignettes/wfs_wcs.Rmd @@ -33,46 +33,43 @@ The tutorial takes a more hands-on coding approach to getting data from a WFS, w ## Simple use case without filter -```{r bel-regions} -wfs_regions <- - "https://eservices.minfin.fgov.be/arcgis/services/R2C/Regions/MapServer/WFSServer" # nolint +```{r provinces} +wfs_vrbg <- "https://geo.api.vlaanderen.be/VRBG/wfs" -bel_regions <- get_feature_wfs( - wfs = wfs_regions, - layername = "regions", +provinces <- get_feature_wfs( + wfs = wfs_vrbg, + layername = "VRBG:Refprv", crs = "EPSG:31370" ) -bel_regions +provinces ``` You can achieve (almost) the same result using a combination of `sf::read_sf()` and `sf::st_transform()`. ```{r} -bel_regions2 <- read_sf(paste0("WFS:", wfs_regions), - layer = "regions" -) %>% - st_transform(crs = 31370) +provinces2 <- read_sf(paste0("WFS:", wfs_vrbg), + layer = "VRBG:Refprv" +) -waldo::compare(bel_regions, bel_regions2, +waldo::compare(provinces, provinces2, x_arg = "inbospatial", y_arg = "sf", max_diffs = 8 ) ``` -There are however a number of differences. -Most notably, a couple of fields have a different field type and the geometry column is a `"MULTIPOLYGON"` in the first instance yet a `"MULTISURFACE"` in the second case. -The reason for these differences is that `get_feature_wfs()` retrieves whatever information that is identified from the WFS request - in the same way as you would paste the request in the browser. +Both methods yield the same result. +Note however that for other examples, you may notice substantial differences, most notably for field specifications. +The reason for such differences is that `get_feature_wfs()` retrieves whatever information that is identified from the WFS request - in the same way as you would paste the request in the browser. This result is then saved temporarily to a `.GML` file and read with `sf::read_sf()`. -Passing the WFS directly to the `dsn` argument of `sf::read_sf`, on the other hand, will translate the request to a form that will pass through [the GDAL WFS driver](https://gdal.org/drivers/vector/wfs.html), which handles field specifications by reading them from a `DescribeFeatureType` request: +Passing the WFS directly to the `dsn` argument of `sf::read_sf`, on the other hand, will translate the request to a form that will pass through [the GDAL WFS driver](https://gdal.org/en/latest/drivers/vector/wfs.html), which handles field specifications by reading them from a `DescribeFeatureType` request: > At the first opening, the content of the result of the `GetCapabilities` request will be appended to the file, so that it can be cached for later openings of the dataset. The same applies for the `DescribeFeatureType` request issued to discover the field definition of each layer. ## Apply a CQL-Filter to filter on a field ```{r prov} -wfs_vrbg <- - "https://geo.api.vlaanderen.be/VRBG/wfs" +wfs_vrbg <- "https://geo.api.vlaanderen.be/VRBG/wfs" prov <- get_feature_wfs( wfs = wfs_vrbg, @@ -93,13 +90,12 @@ prov2 <- read_sf(paste0("WFS:", wfs_vrbg), waldo::compare(prov, prov2) ``` -This time, both methods yield the same result. +Both methods yield the same result. ## Request a subset of fields ```{r prov-fields} -wfs_vrbg <- - "https://geo.api.vlaanderen.be/VRBG/wfs" +wfs_vrbg <- "https://geo.api.vlaanderen.be/VRBG/wfs" prov_fields <- get_feature_wfs( wfs = wfs_vrbg, @@ -111,7 +107,7 @@ prov_fields <- get_feature_wfs( prov_fields ``` -Again, we can use `sf::read_sf()` in combination with an [OGR SQL query](https://gdal.org/user/ogr_sql_dialect.html): +Again, we can use `sf::read_sf()` in combination with an [OGR SQL query](https://gdal.org/en/latest/user/ogr_sql_dialect.html): ```{r} prov_fields_sf <- read_sf(paste0("WFS:", wfs_vrbg), @@ -170,14 +166,13 @@ bwk_bbox <- get_feature_wfs( bwk_bbox ``` -This returns a `CURVEPOLYGON` geometry type. +This returns a `MULTISURFACE` geometry type. We can use a couple of `sf` functions to cast this to regular polygons: ```{r} bwk_bbox %>% st_cast("GEOMETRYCOLLECTION") %>% - st_collection_extract("LINESTRING") %>% - st_cast("POLYGON") %>% + st_collection_extract("POLYGON") %>% st_geometry() %>% plot() ``` @@ -267,5 +262,3 @@ dtm <- get_coverage_wcs( resolution = 1) terra::plot(dtm) ``` - - From 15a86c535915f9ac1ceecc0ac888e37cef6348f3 Mon Sep 17 00:00:00 2001 From: hansvancalster Date: Wed, 16 Oct 2024 16:51:11 +0200 Subject: [PATCH 04/13] fix url --- README.Rmd | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.Rmd b/README.Rmd index 1d5a7d1..07ff1dc 100644 --- a/README.Rmd +++ b/README.Rmd @@ -18,7 +18,7 @@ knitr::opts_chunk$set( [![Project Status: Concept – Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept.](https://www.repostatus.org/badges/latest/concept.svg)](https://www.repostatus.org/#concept) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://opensource.org/license/mit/) +[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://opensource.org/license/mit) [![Release](https://img.shields.io/github/release/inbo/inbospatial.svg)](https://github.com/inbo/inbospatial/releases) ![GitHub](https://img.shields.io/github/license/inbo/inbospatial) [![R build status](https://github.com/inbo/inbospatial/workflows/check%20package%20on%20main/badge.svg)](https://github.com/inbo/inbospatial/actions) diff --git a/README.md b/README.md index 362e783..ee4fb27 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ or proof-of-concept.](https://www.repostatus.org/badges/latest/concept.svg)](https://www.repostatus.org/#concept) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://opensource.org/license/mit/) +[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://opensource.org/license/mit) [![Release](https://img.shields.io/github/release/inbo/inbospatial.svg)](https://github.com/inbo/inbospatial/releases) ![GitHub](https://img.shields.io/github/license/inbo/inbospatial) [![R build From b137992ae1c1bb9d630ae89909b2e1cff005dabf Mon Sep 17 00:00:00 2001 From: hansvancalster Date: Wed, 16 Oct 2024 17:19:37 +0200 Subject: [PATCH 05/13] fix url --- vignettes/wfs_wcs.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/wfs_wcs.Rmd b/vignettes/wfs_wcs.Rmd index eec34cf..debe6b9 100644 --- a/vignettes/wfs_wcs.Rmd +++ b/vignettes/wfs_wcs.Rmd @@ -80,7 +80,7 @@ prov <- get_feature_wfs( prov ``` -Here, we could have also used `sf::read_sf()` in combination with an [OGR SQL query](https://gdal.org/user/ogr_sql_dialect.html): +Here, we could have also used `sf::read_sf()` in combination with an [OGR SQL query](https://gdal.org/en/latest/user/ogr_sql_dialect.html): ```{r} prov2 <- read_sf(paste0("WFS:", wfs_vrbg), From 464469782badef53e843d35bafe8a547b30889b3 Mon Sep 17 00:00:00 2001 From: hansvancalster Date: Thu, 17 Oct 2024 08:50:21 +0200 Subject: [PATCH 06/13] use II* as cue for start of geoTIFF --- R/get_coverage_wcs.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/get_coverage_wcs.R b/R/get_coverage_wcs.R index 24ccfc4..a28cade 100644 --- a/R/get_coverage_wcs.R +++ b/R/get_coverage_wcs.R @@ -189,7 +189,7 @@ unpack_mht <- function(path) { raw_vector <- read_file_raw(path) assert_that(any(str_detect(lines_char, "image/tiff"))) - start <- max(which(str_detect(lines_char, "Content-"))) + 1 + start <- which(str_detect(lines_char, "^II\\*")) end <- length(lines_raw) - 1 pos_start <- length(unlist(lines_raw[1:(start - 1)])) + start pos_end <- length(raw_vector) - (length(lines_raw[end + 1]) + 1) From f5e9330beaddfd294f68cb4a0d173c6ab40adb40 Mon Sep 17 00:00:00 2001 From: hansvancalster Date: Thu, 17 Oct 2024 08:58:54 +0200 Subject: [PATCH 07/13] fix invalid url notes --- R/get_feature_wfs.R | 5 +++-- man/get_feature_wfs.Rd | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/R/get_feature_wfs.R b/R/get_feature_wfs.R index 06d2b7c..79c7808 100644 --- a/R/get_feature_wfs.R +++ b/R/get_feature_wfs.R @@ -6,7 +6,7 @@ #' The request is made up of key-value pairs and additional key-value pairs can #' be passed to the function. #' The full documentation for the `WFS` standard can be consulted from -#' \url{https://www.ogc.org/standard/wfs/}. +#' \url{https://www.ogc.org/publications/standard/wfs/}. #' #' @param wfs Web address for the service which you want to query features from #' @param version Version number for the service. @@ -18,7 +18,8 @@ #' Pass this as a named vector with names `"xmin"`, `"xmax"`, `"ymin"`, #' `"ymax"`. #' @param filter Optional -#' [standard OGC filter](https://www.ogc.org/standard/filter/) specification +#' [standard OGC filter](https://www.ogc.org/publications/standard/filter/) +#' specification #' @param cql_filter Optional #' [Contextual Query Language](https://portal.ogc.org/files/96288) filter. #' This currently only works if the `WFS` is hosted on a `GeoServer`. diff --git a/man/get_feature_wfs.Rd b/man/get_feature_wfs.Rd index 57d5fca..a82e7c3 100644 --- a/man/get_feature_wfs.Rd +++ b/man/get_feature_wfs.Rd @@ -34,7 +34,8 @@ Pass this as a named vector with names \code{"xmin"}, \code{"xmax"}, \code{"ymin \code{"ymax"}.} \item{filter}{Optional -\href{https://www.ogc.org/standard/filter/}{standard OGC filter} specification} +\href{https://www.ogc.org/publications/standard/filter/}{standard OGC filter} +specification} \item{cql_filter}{Optional \href{https://portal.ogc.org/files/96288}{Contextual Query Language} filter. @@ -62,7 +63,7 @@ features that are requested. The request is made up of key-value pairs and additional key-value pairs can be passed to the function. The full documentation for the \code{WFS} standard can be consulted from -\url{https://www.ogc.org/standard/wfs/}. +\url{https://www.ogc.org/publications/standard/wfs/}. } \details{ See From adaf2be4253078bfae7b15e42a76c4677c502a65 Mon Sep 17 00:00:00 2001 From: Falk Mielke Date: Fri, 18 Oct 2024 08:52:46 +0200 Subject: [PATCH 08/13] patch-mht: wfs/wcs vignette additions --- vignettes/wfs_wcs.Rmd | 44 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/vignettes/wfs_wcs.Rmd b/vignettes/wfs_wcs.Rmd index debe6b9..19cd88a 100644 --- a/vignettes/wfs_wcs.Rmd +++ b/vignettes/wfs_wcs.Rmd @@ -33,6 +33,8 @@ The tutorial takes a more hands-on coding approach to getting data from a WFS, w ## Simple use case without filter +As a test case, we will query municipal boundaries of Flanders from the "Provisional Reference Municipal Boundaries" (VRBG, "Voorlopig ReferentieBestand Gemeentegrenzen"), which is available via an API on the *vlaanderen.be* website. + ```{r provinces} wfs_vrbg <- "https://geo.api.vlaanderen.be/VRBG/wfs" @@ -68,6 +70,11 @@ Passing the WFS directly to the `dsn` argument of `sf::read_sf`, on the other ha ## Apply a CQL-Filter to filter on a field +CQL, the "Common Query Language" ([see here, for example](https://docs.geoserver.org/stable/en/user/tutorials/cql/cql_tutorial.html)), provides a way to filter WFS data. +The syntax of [CQL is comparable to SQL](https://www.webcomand.com/docs/language/cql/cql_vs_sql), yet there are differences in data types and structures. + +You can provide and apply filters in `get_feature_wfs()` via the `cql_filter` argument. + ```{r prov} wfs_vrbg <- "https://geo.api.vlaanderen.be/VRBG/wfs" @@ -84,7 +91,7 @@ Here, we could have also used `sf::read_sf()` in combination with an [OGR SQL qu ```{r} prov2 <- read_sf(paste0("WFS:", wfs_vrbg), - query = "select * from Refprv where NAAM='West-Vlaanderen'" + query = "SELECT * FROM Refprv WHERE NAAM='West-Vlaanderen'" ) waldo::compare(prov, prov2) @@ -94,6 +101,10 @@ Both methods yield the same result. ## Request a subset of fields +Instead of querying the complete data table, one can select a subset of variables (fields). +The function `get_feature_wfs()` provides the `property_name` keyword for it, which accepts a string of comma-separated field names. +Note that field names are capitalized on this particular geoserver. + ```{r prov-fields} wfs_vrbg <- "https://geo.api.vlaanderen.be/VRBG/wfs" @@ -111,7 +122,7 @@ Again, we can use `sf::read_sf()` in combination with an [OGR SQL query](https:/ ```{r} prov_fields_sf <- read_sf(paste0("WFS:", wfs_vrbg), - query = "select NAAM, NUTS2 from Refprv" + query = "SELECT NAAM, NUTS2 FROM Refprv" ) waldo::compare(prov_fields, prov_fields_sf) @@ -119,6 +130,9 @@ waldo::compare(prov_fields, prov_fields_sf) ## Meteorological data example +Another example of a WFS API is the Belgian Royal Metheorological Institute (KMI, "Koninklijk Meteorologisch Instituut van België"). +Details can be [found here](https://opendata.meteo.be/service/wfs?request=GetCapabilities), [and here](https://publish.geo.be/geonetwork/f0ow2say/api/records/RMI_AWS_WFS). + ```{r stations} kmi <- "https://opendata.meteo.be/service/wfs" @@ -152,6 +166,10 @@ kmi_synop ## Spatial filtering using a bounding box +Few analyses will require a whole countries' data, even if the country is as small as Belgium. +Hence, it might be useful by restricting the data you query with a bounding box. +This works as follows, using a `bbox` with the elements `xmin`, `ymin`, `xmax`, and `ymax`. + ```{r bwk-bbox} wfs_bwk <- "https://geo.api.vlaanderen.be/BWK/wfs" @@ -197,8 +215,13 @@ bwk_bbox_sf <- read_sf( ## Spatial filters using spatial binary predicates +In addition to the filters above, you can use logical operations to restrict your area of interest. +For example, features can be selected by intersection with another geo-object. + ### Intersects a point +As a proof of concept, we can directly query soil parameters at a specific location. + ```{r} wfs_soiltypes <- "https://www.dov.vlaanderen.be/geoserver/bodemkaart/bodemtypes/wfs" @@ -219,12 +242,15 @@ soil_type <- get_feature_wfs( soil_type ``` +In theory, this should also be possible "the `sf` way". +However, `sf` filters after query (which takes a long time), and the code below does not work correctly. + ```{r eval=FALSE} soil_type_sf <- read_sf( paste0("WFS:", wfs_soiltypes), - query = "select * from bodemtypes", + query = "SELECT * FROM bodemtypes", wkt_filter = sprintf( - "ST_Intersects(geom,POINT(%s %s))", + "ST_Intersects(geom,ST_Point(%s, %s))", x_lam, y_lam ) ) @@ -234,7 +260,11 @@ soil_type_sf # WCS examples -Example of a false-colour infrared image. +Above, we covered Web Feature Services (WFS), which are many kinds of vector data. +Another common geographical data type are grid-like or "raster" data, which you can retrieve via *Web Coverage Services (WCS)*. +Behold, there is a `get_coverage_wcs()` available for some of the web services we regularly use at INBO. + +Below the example of a false-colour infrared image. The three bands of the image are visualized using `terra::plotRGB`. ```{r omz-example} @@ -252,7 +282,7 @@ omz <- get_coverage_wcs( terra::plotRGB(omz) ``` -Example of extracting the digital terrain model for the same bounding box: +Another example, this time extracting the digital terrain model for the same bounding box: ```{r dtm-example} dtm <- get_coverage_wcs( @@ -262,3 +292,5 @@ dtm <- get_coverage_wcs( resolution = 1) terra::plot(dtm) ``` + +More details on WCS can be found in the `spatial_dhmv_query.Rmd` vignette. From 93a2959b488e21d527788d72e5a9720dd1178328 Mon Sep 17 00:00:00 2001 From: hansvancalster Date: Mon, 21 Oct 2024 15:10:51 +0200 Subject: [PATCH 09/13] address warning about deprecated bootstrap 3 --- _pkgdown.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_pkgdown.yml b/_pkgdown.yml index 7ced797..f724786 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -34,3 +34,7 @@ reference: - title: Functions to explore properties of coordinate reference systems contents: - has_concept("functions to explore properties of coordinate reference systems") + +template: + bootstrap: 5 + From 975fc555374f766ec701274d4c64e4e4193264ff Mon Sep 17 00:00:00 2001 From: hansvancalster Date: Mon, 21 Oct 2024 15:11:15 +0200 Subject: [PATCH 10/13] fix URLs --- R/get_feature_wfs.R | 2 +- man/get_feature_wfs.Rd | 2 +- vignettes/wfs_wcs.Rmd | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/R/get_feature_wfs.R b/R/get_feature_wfs.R index 79c7808..02d394c 100644 --- a/R/get_feature_wfs.R +++ b/R/get_feature_wfs.R @@ -41,7 +41,7 @@ #' @importFrom assertthat assert_that is.string #' #' @details See -#' \url{https://inbo.github.io/tutorials/tutorials/spatial_wfs_services/} +#' \url{https://tutorials.inbo.be/tutorials/spatial_wfs_services/} #' for more information. #' @family topics on using web services #' diff --git a/man/get_feature_wfs.Rd b/man/get_feature_wfs.Rd index a82e7c3..e6615e2 100644 --- a/man/get_feature_wfs.Rd +++ b/man/get_feature_wfs.Rd @@ -67,7 +67,7 @@ The full documentation for the \code{WFS} standard can be consulted from } \details{ See -\url{https://inbo.github.io/tutorials/tutorials/spatial_wfs_services/} +\url{https://tutorials.inbo.be/tutorials/spatial_wfs_services/} for more information. } \examples{ diff --git a/vignettes/wfs_wcs.Rmd b/vignettes/wfs_wcs.Rmd index 19cd88a..b6933fe 100644 --- a/vignettes/wfs_wcs.Rmd +++ b/vignettes/wfs_wcs.Rmd @@ -26,14 +26,14 @@ A WFS or Web Feature Service allows you to download vector spatial data from the A WCS or Web Coverage Service is similar, but is used for raster spatial data. In this vignette, we will show how to the functions `get_feature_wfs()` and `get_coverage_wcs()` can be used to get data into your R session from these services. -For a more in-depth explanation about WFS services, we refer to [the INBO tutorial about WFS](https://inbo.github.io/tutorials/tutorials/spatial_wfs_services/){target="_BLANK"}. +For a more in-depth explanation about WFS services, we refer to [the INBO tutorial about WFS](https://tutorials.inbo.be/tutorials/tutorials/spatial_wfs_services/){target="_BLANK"}. The tutorial takes a more hands-on coding approach to getting data from a WFS, whereas in this vignette much of the coding stuff is hidden away in the `get_feature_wfs()` function. # WFS examples ## Simple use case without filter -As a test case, we will query municipal boundaries of Flanders from the "Provisional Reference Municipal Boundaries" (VRBG, "Voorlopig ReferentieBestand Gemeentegrenzen"), which is available via an API on the *vlaanderen.be* website. +As a test case, we will query municipal boundaries of Flanders from the "Provisional Reference Municipal Boundaries" (`VRBG`, `Voorlopig ReferentieBestand Gemeentegrenzen`), which is available via an API on the `vlaanderen.be` website. ```{r provinces} wfs_vrbg <- "https://geo.api.vlaanderen.be/VRBG/wfs" @@ -71,7 +71,7 @@ Passing the WFS directly to the `dsn` argument of `sf::read_sf`, on the other ha ## Apply a CQL-Filter to filter on a field CQL, the "Common Query Language" ([see here, for example](https://docs.geoserver.org/stable/en/user/tutorials/cql/cql_tutorial.html)), provides a way to filter WFS data. -The syntax of [CQL is comparable to SQL](https://www.webcomand.com/docs/language/cql/cql_vs_sql), yet there are differences in data types and structures. +The syntax of [CQL is comparable to SQL](https://www.webcomand.com/docs/language/cql/cql_vs_sql/), yet there are differences in data types and structures. You can provide and apply filters in `get_feature_wfs()` via the `cql_filter` argument. @@ -130,7 +130,7 @@ waldo::compare(prov_fields, prov_fields_sf) ## Meteorological data example -Another example of a WFS API is the Belgian Royal Metheorological Institute (KMI, "Koninklijk Meteorologisch Instituut van België"). +Another example of a WFS API is the Belgian Royal Meteorological Institute (KMI, `Koninklijk Meteorologisch Instituut van België`). Details can be [found here](https://opendata.meteo.be/service/wfs?request=GetCapabilities), [and here](https://publish.geo.be/geonetwork/f0ow2say/api/records/RMI_AWS_WFS). ```{r stations} @@ -216,7 +216,7 @@ bwk_bbox_sf <- read_sf( ## Spatial filters using spatial binary predicates In addition to the filters above, you can use logical operations to restrict your area of interest. -For example, features can be selected by intersection with another geo-object. +For example, features can be selected by intersection with another geographical object. ### Intersects a point From 078d44aa63977014d55cb0cff1266685fc203a84 Mon Sep 17 00:00:00 2001 From: hansvancalster Date: Mon, 21 Oct 2024 15:11:30 +0200 Subject: [PATCH 11/13] update dictionary --- inst/en_gb.dic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inst/en_gb.dic b/inst/en_gb.dic index a8becd8..aa29273 100644 --- a/inst/en_gb.dic +++ b/inst/en_gb.dic @@ -13,7 +13,6 @@ Iliffe KMI LCC Landschaptypen -linter MULTIPOLYGON MULTSURFACE NNB @@ -50,11 +49,13 @@ edn fl forestnature futureproof +geoserver grbmap habitatlabels habitatmap inbospatial landschapstypen +linter natte natuurparels natuurtypen From 61c09bca3603fdfafe6f60e248c02ace26c15a5e Mon Sep 17 00:00:00 2001 From: hansvancalster Date: Mon, 21 Oct 2024 15:14:25 +0200 Subject: [PATCH 12/13] add NEWS item --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 34de59d..cb0bd5e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # inbospatial 0.0.3 +## Bug fixes + +* fix parsing of `geoTIFF` part from `mht` files (internal function) + # inbospatial 0.0.2 ## New functions From 57dd814a59689576b8c3c661d29a316190c9e9c1 Mon Sep 17 00:00:00 2001 From: hansvancalster Date: Mon, 21 Oct 2024 15:16:38 +0200 Subject: [PATCH 13/13] fix URL --- vignettes/wfs_wcs.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/wfs_wcs.Rmd b/vignettes/wfs_wcs.Rmd index b6933fe..d1255ed 100644 --- a/vignettes/wfs_wcs.Rmd +++ b/vignettes/wfs_wcs.Rmd @@ -26,7 +26,7 @@ A WFS or Web Feature Service allows you to download vector spatial data from the A WCS or Web Coverage Service is similar, but is used for raster spatial data. In this vignette, we will show how to the functions `get_feature_wfs()` and `get_coverage_wcs()` can be used to get data into your R session from these services. -For a more in-depth explanation about WFS services, we refer to [the INBO tutorial about WFS](https://tutorials.inbo.be/tutorials/tutorials/spatial_wfs_services/){target="_BLANK"}. +For a more in-depth explanation about WFS services, we refer to [the INBO tutorial about WFS](https://tutorials.inbo.be/tutorials/spatial_wfs_services/){target="_BLANK"}. The tutorial takes a more hands-on coding approach to getting data from a WFS, whereas in this vignette much of the coding stuff is hidden away in the `get_feature_wfs()` function. # WFS examples