-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#69 GMLParameterValue, GMLParameterValueGroup
- Loading branch information
Showing
11 changed files
with
584 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#' GMLAbstractGeneralParameterValue | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO GML Abstract GeneralParameterValue | ||
#' @return Object of \code{\link{R6Class}} for modelling an GML abstract general ParameterValue | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' @section Methods: | ||
#' \describe{ | ||
#' \item{\code{new(xml, element, attrs, defaults)}}{ | ||
#' This method is used to instantiate a GML abstract GML | ||
#' } | ||
#' } | ||
#' | ||
#' @note Class used internally by geometa | ||
#' | ||
#' @references | ||
#' ISO 19136:2007 Geographic Information -- Geographic Markup Language. | ||
#' http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=32554 | ||
#' | ||
#' OGC Geography Markup Language. http://www.opengeospatial.org/standards/gml | ||
#' | ||
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com> | ||
#' | ||
GMLAbstractGeneralParameterValue <- R6Class("GMLAbstractGeneralParameterValue", | ||
inherit = GMLAbstractObject, | ||
private = list( | ||
xmlElement = "AbstractGeneralParameterValue", | ||
xmlNamespacePrefix = "GML" | ||
), | ||
public = list( | ||
initialize = function(xml = NULL, element = NULL, attrs = list(), defaults = list()){ | ||
if(is.null(element)) element <- private$xmlElement | ||
super$initialize(xml, element = element, attrs = attrs, defaults = defaults, wrap = TRUE) | ||
} | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
#' GMLParameterValue | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO GML parameter value | ||
#' @return Object of \code{\link{R6Class}} for modelling an GML parameter value | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' @field value | ||
#' @field operationParameter | ||
#' | ||
#' @section Methods: | ||
#' \describe{ | ||
#' \item{\code{new(xml, defaults)}}{ | ||
#' This method is used to instantiate a GML ParameterValue | ||
#' } | ||
#' \item{\code{setValue(value,uom)}}{ | ||
#' Sets the value (object of class "numeric"), with unit of measure (uom) | ||
#' } | ||
#' \item{\code{setStringValue(value)}}{ | ||
#' Sets a string value | ||
#' } | ||
#' \item{\code{setIntegerValue(value)}}{ | ||
#' Sets an integer value | ||
#' } | ||
#' \item{\code{setBooleanValue(value)}}{ | ||
#' Sets a boolean value | ||
#' } | ||
#' \item{\code{setValueFile(value)}}{ | ||
#' Sets a file value | ||
#' } | ||
#' \item{\code{setOperationParameter(operationParameter)}}{ | ||
#' Sets the operation parameter, object of class \code{GMLOperationParameter} | ||
#' } | ||
#' } | ||
#' | ||
#' @examples | ||
#' gml <- GMLParameterValue$new() | ||
#' gml$setValue(1.1, "test") | ||
#' op <- GMLOperationParameter$new() | ||
#' op$setDescriptionReference("someref") | ||
#' op$setIdentifier("identifier", "codespace") | ||
#' op$addName("name1", "codespace") | ||
#' op$addName("name2", "codespace") | ||
#' op$setMinimumOccurs(2L) | ||
#' gml$setOperationParameter(op) | ||
#' xml <- gml$encode() | ||
#' | ||
#' @references | ||
#' ISO 19136:2007 Geographic Information -- Geographic Markup Language. | ||
#' http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=32554 | ||
#' | ||
#' OGC Geography Markup Language. http://www.opengeospatial.org/standards/gml | ||
#' | ||
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com> | ||
#' | ||
GMLParameterValue <- R6Class("GMLParameterValue", | ||
inherit = GMLAbstractGeneralParameterValue, | ||
private = list( | ||
xmlElement = "ParameterValue", | ||
xmlNamespacePrefix = "GML" | ||
), | ||
public = list( | ||
value = NULL, | ||
stringValue = NULL, | ||
integerValue = NULL, | ||
booleanValue = NULL, | ||
valueList = NULL, #TODO | ||
integerValueList = NULL, #TODO | ||
valueFile = NULL, | ||
operationParameter = NULL, | ||
initialize = function(xml = NULL, defaults = list()){ | ||
super$initialize(xml, element = private$xmlElement, defaults) | ||
}, | ||
|
||
#setValue | ||
setValue = function(value, uom){ | ||
if(!is(value, "numeric")){stop("Value should be an object of class 'numeric'")} | ||
valueElem <- GMLElement$new(element = "value") | ||
valueElem$setValue(value) | ||
valueElem$attrs <- list(uom = uom) | ||
self$value <- valueElem | ||
}, | ||
|
||
#setStringValue | ||
setStringValue = function(value){ | ||
valueElem <- GMLElement$new(element = "stringValue") | ||
valueElem$setValue(value) | ||
self$stringValue <- valueElem | ||
}, | ||
|
||
#setIntegerValue | ||
setIntegerValue = function(value){ | ||
if(!is(value, "integer")){stop("Value should be an object of class 'integer'")} | ||
valueElem <- GMLElement$new(element = "integerValue") | ||
valueElem$setValue(value) | ||
self$integerValue <- valueElem | ||
}, | ||
|
||
#setBooleanValue | ||
setBooleanValue = function(value){ | ||
if(!is(value, "logical")){stop("Value should be an object of class 'logical'")} | ||
valueElem <- GMLElement$new(element = "booleanValue") | ||
valueElem$setValue(value) | ||
self$booleanValue <- valueElem | ||
}, | ||
|
||
#setValueFile | ||
setValueFile = function(value){ | ||
if(!is(value, "character")){stop("Value should be an object of class 'character'")} | ||
valueElem <- GMLElement$new(element = "valueFile") | ||
valueElem$setValue(value) | ||
self$valueFile <- valueElem | ||
}, | ||
|
||
#setOperationParameter | ||
setOperationParameter = function(operationParameter){ | ||
if(!is(operationParameter, "GMLOperationParameter")){ | ||
stop("Input 'operationParameter' should be of an object oftype 'GMLOperationParameter'") | ||
} | ||
self$operationParameter <- operationParameter | ||
} | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#' GMLParameterValueGroup | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO GML parameter value group | ||
#' @return Object of \code{\link{R6Class}} for modelling an GML parameter value group | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' @field parameterValue | ||
#' @field group | ||
#' | ||
#' @section Methods: | ||
#' \describe{ | ||
#' \item{\code{new(xml, defaults)}}{ | ||
#' This method is used to instantiate a GML ParameterValue | ||
#' } | ||
#' \item{\code{addParameterValue(parameterValue)}}{ | ||
#' Adds a parameter value, object of class 'GMLParameterValue' | ||
#' } | ||
#' \item{\code{delParameterValue(parameterValue)}}{ | ||
#' Deletes a parameter value, object of class 'GMLParameterValue' | ||
#' } | ||
#' \item{\code{setOperationParameterGroup(operationParameterGroup)}}{ | ||
#' Sets the operation parameter group, object of class \code{GMLOperationParameterGroup} | ||
#' } | ||
#' } | ||
#' | ||
#' @examples | ||
#' gml <- GMLParameterValueGroup$new() | ||
#' | ||
#' @references | ||
#' ISO 19136:2007 Geographic Information -- Geographic Markup Language. | ||
#' http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=32554 | ||
#' | ||
#' OGC Geography Markup Language. http://www.opengeospatial.org/standards/gml | ||
#' | ||
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com> | ||
#' | ||
GMLParameterValueGroup <- R6Class("GMLParameterValueGroup", | ||
inherit = GMLAbstractGeneralParameterValue, | ||
private = list( | ||
xmlElement = "ParameterValueGroup", | ||
xmlNamespacePrefix = "GML" | ||
), | ||
public = list( | ||
parameterValue = list(), | ||
group = NULL, | ||
initialize = function(xml = NULL, defaults = list()){ | ||
super$initialize(xml, element = private$xmlElement, defaults) | ||
}, | ||
|
||
#addParameterValue | ||
addParameterValue = function(parameterValue){ | ||
if(!is(parameterValue, "GMLParameterValue")){ | ||
stop("Input should be an object of class 'GMLParameterValue") | ||
} | ||
return(self$addListElement("parameterValue", parameterValue)) | ||
}, | ||
|
||
#delParameterValue | ||
delParameterValue = function(parameterValue){ | ||
if(!is(parameterValue, "GMLParameterValue")){ | ||
stop("Input should be an object of class 'GMLParameterValue") | ||
} | ||
return(self$delListElement("parameterValue", parameterValue)) | ||
}, | ||
|
||
#setOperationParameterGroup | ||
setOperationParameterGroup = function(operationParameterGroup){ | ||
if(!is(operationParameterGroup, "GMLOperationParameterGroup")){ | ||
stop("Input 'operationParameterGroup' should be of an object oftype 'GMLOperationParameterGroup'") | ||
} | ||
self$group <- operationParameterGroup | ||
} | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.