Skip to content

Commit

Permalink
#9 consolidate dimensions subset handling
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Mar 4, 2022
1 parent 2405e61 commit cf516c5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions R/WCSGetCoverage.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,16 @@ WCSGetCoverage <- R6Class("WCSGetCoverage",

#time is not necessarily handled as character, need to identify with
#srsName the crs if spatial or temporal
if(is.character(unlist(envelope$lowerCorner[,i])) & is.character(unlist(envelope$upperCorner[,i]))){
if(is.null(time)) time <- envelope$upperCorner[,i]
subsetKvp <- sprintf("%s(\"%s\")",subset, time)
if(tolower(subset) %in% c("time", "elevation")){
value <- NULL
if(tolower(subset)=="time") value <- time
if(tolower(subset)=="elevation") value <- elevation
if(is.null(value)) value <- envelope$upperCorner[,i]
if(is(value, "character")){
subsetKvp <- sprintf("%s(\"%s\",\"%s\")",subset, value, value)
}else{
subsetKvp <- sprintf("%s(%s,%s)",subset, value, value)
}
}
URLencode(subsetKvp)
})
Expand Down

0 comments on commit cf516c5

Please sign in to comment.