Skip to content

Commit

Permalink
#9 fix serviceVersion-owsVersion mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Feb 14, 2022
1 parent 838f94f commit 28053d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions R/WCSCapabilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,18 @@ WCSCapabilities <- R6Class("WCSCapabilities",
#'@param ... any other parameter to pass to \link{OWSGetCapabilities} service request
initialize = function(url, version, client = NULL, logger = NULL, ...) {
owsVersion <- switch(version,
"1.0" = "1.1",
"1.0" = "1.1",
"1.0.0" = "1.1",
"1.1" = "1.1",
"1.1.0" = "1.1",
"1.1.1" = "1.1",
"2.0.0" = "2.0",
"2.0.1" = "2.0"
"2.0.1" = "2.0",
NULL
)
if(is.null(owsVersion)){
stop(sprintf("Unknown WCS service version '%s'", version))
}
super$initialize(element = private$xmlElement, namespacePrefix = private$xmlNamespacePrefix,
url, service = "WCS", owsVersion = owsVersion, serviceVersion = version,
client = client, logger = logger, ...)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_WCSClient_v1_1.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test_that("WCS 1.1.1 - GeoServer",{
expect_is(sfdem, "WCSCoverageSummary")
sfdem_desc <- sfdem$getDescription()
expect_is(sfdem_desc, "WCSCoverageDescription")
domain <- sfdem_desc$getDomain()

expect_is(domain, "WCSCoverageDomain")
expect_is(domain$getSpatialDomain(), "WCSCoverageSpatialDomain")
})
Expand Down

0 comments on commit 28053d6

Please sign in to comment.