Skip to content

Commit

Permalink
Merge pull request #51 from abennici/master
Browse files Browse the repository at this point in the history
#43 add option 'time_format' to getDimensions and getTimeDimension fo…
  • Loading branch information
eblondel authored Jul 13, 2021
2 parents 80cc927 + 40a198c commit c122da5
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions R/WMSLayer.R
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,23 @@ WMSLayer <- R6Class("WMSLayer",
},

#getDimensions
getDimensions = function(){
return(private$dimensions)
getDimensions = function(time_format = "character"){
dimensions <- private$dimensions
if(time_format=="posix"){
dimensions[["time"]]$default<-as.POSIXct(dimensions[["time"]]$default,format="%Y-%m-%dT%H:%M:%OSZ")
dimensions[["time"]]$values<-as.POSIXct(dimensions[["time"]]$values,format="%Y-%m-%dT%H:%M:%OSZ")
}
return(dimensions)
},

#getTimeDimension
getTimeDimension = function(){
return(private$dimensions[["time"]])
getTimeDimension = function(time_format = "character"){
time_dimensions <- private$dimensions[["time"]]
if(time_format=="posix"){
time_dimensions$default<-as.POSIXct(time_dimensions$default,format="%Y-%m-%dT%H:%M:%OSZ")
time_dimensions$values<-as.POSIXct(time_dimensions$values,format="%Y-%m-%dT%H:%M:%OSZ")
}
return(time_dimensions)
},

#getElevationDimension
Expand All @@ -260,7 +270,7 @@ WMSLayer <- R6Class("WMSLayer",
#getFeatureInfo
getFeatureInfo = function(srs = NULL, styles = NULL, feature_count = 1,
x, y, width, height, bbox,
info_format = "application/vnd.ogc.gml",
info_format = "text/xml",
...){

if(is.null(styles)){
Expand Down

0 comments on commit c122da5

Please sign in to comment.