diff --git a/DESCRIPTION b/DESCRIPTION index cff5854..1533b82 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ows4R Version: 0.4-1 -Date: 2024-12-01 +Date: 2024-12-09 Title: Interface to OGC Web-Services (OWS) Authors@R: c(person("Emmanuel", "Blondel", role = c("aut", "cre"), email = "emmanuel.blondel1@gmail.com", comment = c(ORCID = "0000-0002-5870-5762")), person("Alexandre", "Bennici", role = c("ctb"), comment = c(ORCID = "0000-0003-2160-3487")), diff --git a/NEWS.md b/NEWS.md index 8a6e524..a9e34e6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,10 @@ - [#129](https://github.com/eblondel/ows4R/issues/129) WFS FeatureType missing control to inherit element type +**Enhancements** + +- [#130](https://github.com/eblondel/ows4R/issues/130) WFS 2.0 - Support count parameter in case maxFeatures is used + ## [ows4R 0.4](https://github.com/eblondel/ows4R) | [![CRAN_Status_Badge](https://img.shields.io/badge/CRAN-published-blue.svg)](https://github.com/eblondel/ows4R) **Corrections** diff --git a/R/WFSFeatureType.R b/R/WFSFeatureType.R index aafdcc8..3cd2083 100644 --- a/R/WFSFeatureType.R +++ b/R/WFSFeatureType.R @@ -299,6 +299,9 @@ WFSFeatureType <- R6Class("WFSFeatureType", stop("Feature type could not be described, aborting getting features...") } vendorParams <- list(...) + if(startsWith(private$version, "2.0")) if("maxfeatures" %in% tolower(names(vendorParams))){ + names(vendorParams)[tolower(names(vendorParams)) == "maxfeatures"] <- "count" + } if(paging){ hitParams <- vendorParams @@ -344,9 +347,15 @@ WFSFeatureType <- R6Class("WFSFeatureType", } client = private$capabilities$getClient() - ftFeatures <- WFSGetFeature$new(private$capabilities, op = op, private$url, private$version, private$name, outputFormat = outputFormat, - user = client$getUser(), pwd = client$getPwd(), token = client$getToken(), headers = client$getHeaders(), - logger = self$loggerType, ...) + ftFeatures <- do.call( + WFSGetFeature$new, + c( + private$capabilities, op = op, private$url, private$version, private$name, outputFormat = outputFormat, + user = client$getUser(), pwd = client$getPwd(), token = client$getToken(), headers = client$getHeaders(), + logger = self$loggerType, + vendorParams + ) + ) #exception handling if(ftFeatures$hasException()){ return(ftFeatures$getException())