Skip to content

Commit

Permalink
#9 enable getDimensions for WCS 1
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Feb 24, 2022
1 parent f6ce65d commit 60dfc43
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions R/WCSCoverageSummary.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 60dfc43

Please sign in to comment.