From 60dfc437344df7b6636f49da07cca9e77e946a6c Mon Sep 17 00:00:00 2001 From: eblondel Date: Thu, 24 Feb 2022 22:59:24 +0100 Subject: [PATCH] #9 enable getDimensions for WCS 1 --- R/WCSCoverageSummary.R | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/R/WCSCoverageSummary.R b/R/WCSCoverageSummary.R index 66dfaba..91a4f29 100644 --- a/R/WCSCoverageSummary.R +++ b/R/WCSCoverageSummary.R @@ -201,6 +201,24 @@ WCSCoverageSummary <- R6Class("WCSCoverageSummary", dimensions <- NULL des <- self$getDescription() if(!is.null(private$dimensions)) return(private$dimensions) + + #case of WCS 1.x + if(!is.null(des$Domain)){ + dimensions <- list( + list(label = "Lat", uom = "Deg", type = "geographic"), + list(label = "Long",uom = "Deg", type = "geographic") + ) + if(!is.null(des$Domain$temporalDomain)){ + dimensions <- c(dimensions, + list( + label = "time", uom = "s", type = "temporal", + coefficients = des$Domain$temporalDomain$instants + ) + ) + } + } + + #case of WCS 2.x if(!is.null(des$boundedBy)){ self$INFO("Fetching Coverage envelope dimensions by CRS interpretation") srsName <- des$boundedBy$attrs$srsName