Skip to content

Commit

Permalink
#69 support GML operationParameter & operationParameterGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Jun 27, 2017
1 parent 7b7c486 commit 18acb15
Show file tree
Hide file tree
Showing 10 changed files with 592 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export(GMLEllipsoidalCS)
export(GMLGeodeticCRS)
export(GMLLinearCS)
export(GMLObliqueCartesianCS)
export(GMLOperationMethod)
export(GMLOperationParameter)
export(GMLOperationParameterGroup)
export(GMLPolarCS)
Expand Down
55 changes: 55 additions & 0 deletions R/GMLAbstractGeneralOperationParameter.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#' GMLAbstractGeneralOperationParameter
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO GML abstract general operation parameter
#' @return Object of \code{\link{R6Class}} for modelling an GMLAbstractGeneralOperationParameter
#' @format \code{\link{R6Class}} object.
#'
#' @field minimumOccurs
#'
#' @section Inherited methods from \code{GMLDefinition}
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml, defaults, id)}}{
#' This method is used to instantiate a GML AbstractGeneralOperationParameter
#' }
#' \item{\code{setMinimumOccurs(minimumOccurs)}}{
#' Sets the minimum occurs, object of class \code{integer}
#' }
#' }
#'
#' @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>
#'
GMLAbstractGeneralOperationParameter <- R6Class("GMLAbstractGeneralOperationParameter",
inherit = GMLDefinition,
private = list(
xmlElement = "AbstractGeneralOperationParameter",
xmlNamespacePrefix = "GML"
),
public = list(

#+ minimumOccurs [0..1]: integer
minimumOccurs = NULL,

#setMinimumOccurs
setMinimumOccurs = function(minimumOccurs){
if(!is(minimumOccurs, "integer")){
minimumOccurs <- as.integer(minimumOccurs)
if(is.na(minimumOccurs)){
stop("The argument value should be an object of class 'integer'")
}
}
self$minimumOccurs <- GMLElement$create("minimumOccurs", value = minimumOccurs)
}

)
)
112 changes: 112 additions & 0 deletions R/GMLOperationMethod.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#' GMLOperationMethod
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO GML operation method
#' @return Object of \code{\link{R6Class}} for modelling an GMLOperationMethod
#' @format \code{\link{R6Class}} object.
#'
#' @field formulaCitation
#' @field sourceDimensions
#' @field targetDimensions
#'
#' @section Inherited methods from \code{GMLDefinition}
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml, defaults, id)}}{
#' This method is used to instantiate a GML OperationMethod
#' }
#' \item{\code{setFormulaCitation(citation)}}{
#' Sets the formula citation, object of class \code{ISOCitation}
#' }
#' \item{\code{setSourceDimensions(value)}}{
#' Sets the number of source dimensions, object of class \code{integer}
#' }
#' \item{\code{setTargetDimensions(value)}}{
#' Sets the number of target dimensions, object of class \code{integer}
#' }
#' \item{\code{addParameter(parameter)}}{
#' Adds a parameter or parameter group, object of class \code{GMLOperationParameter}
#' or \code{GMLOperationParameterGroup}
#' }
#' \item{\code{delParameter(parameter)}}{
#' Deletes a parameter or parameter group, object of class \code{GMLOperationParameter}
#' or \code{GMLOperationParameterGroupo}
#' }
#' }
#'
#' @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>
#'
GMLOperationMethod <- R6Class("GMLOperationMethod",
inherit = GMLDefinition,
private = list(
xmlElement = "OperationMethod",
xmlNamespacePrefix = "GML"
),
public = list(

#+ formulaCitation [1..1]: ISOCitation
formulaCitation = NA,
#+ sourceDimensions [0..1]: integer
sourceDimensions = NULL,
#+ targetDimensions [0..1]: integer
targetDimensions = NULL,
#+ parameter [0..*]: GMLOperationParameter or GMLOperationParameterGroup
parameter = list(),

#setFormulaCitation
setFormulaCitation = function(citation){
if(!is(citation, "ISOCitation")){
stop("The argument value should be an object of class 'ISOCitation'")
}
self$formulaCitation <- GMLElement$create("formulaCitation", value = citation)
},

#setSourceDimensions
setSourceDimensions = function(value){
if(!is(value, "integer")){
value <- as.integer(value)
if(is.na(value)){
stop("The argument value should an object of class or coerceable to 'integer'")
}
}
self$sourceDimensions <- GMLElement$create("sourceDimensions", value = value)
},

#setTargetDimensions
setTargetDimensions = function(value){
if(!is(value, "integer")){
value <- as.integer(value)
if(is.na(value)){
stop("The argument value should an object of class or coerceable to 'integer'")
}
}
self$targetDimensions <- GMLElement$create("targetDimensions", value = value)
},

#addParameter
addParameter = function(param){
if(!inherits(param, "GMLAbstractGeneralOperationParameter")){
stop("The argument value should be an object of class 'GMLOperationParameter' or 'GMLOperationParameterGroup'")
}
return(self$addListElement("parameter", GMLElement$create("parameter", value = param)))
},

#delParameter
delParameter = function(param){
if(!inherits(param, "GMLAbstractGeneralOperationParameter")){
stop("The argument value should be an object of class 'GMLOperationParameter' or 'GMLOperationParameterGroup'")
}
return(self$delListElement("parameter", GMLElement$create("parameter", value = param)))
}

)
)
34 changes: 34 additions & 0 deletions R/GMLOperationParameter.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#' GMLOperationParameter
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO GML operation parameter
#' @return Object of \code{\link{R6Class}} for modelling an GMLOperationParameter
#' @format \code{\link{R6Class}} object.
#'
#' @section Inherited methods from \code{GMLAbstractGeneralOperationParameter}
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml, defaults, id)}}{
#' This method is used to instantiate a GML OperationParameter
#' }
#' }
#'
#' @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>
#'
GMLOperationParameter <- R6Class("GMLOperationParameter",
inherit = GMLAbstractGeneralOperationParameter,
private = list(
xmlElement = "OperationParameter",
xmlNamespacePrefix = "GML"
),
public = list()
)
82 changes: 82 additions & 0 deletions R/GMLOperationParameterGroup.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#' GMLOperationParameterGroup
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO GML operation parameter group
#' @return Object of \code{\link{R6Class}} for modelling an GMLOperationParameterGroup
#' @format \code{\link{R6Class}} object.
#'
#' @field maximumOccurs
#' @field parameter
#'
#' @section Inherited methods from \code{GMLAbstractGeneralOperationParameter}
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml, defaults, id)}}{
#' This method is used to instantiate a GML OperationParameterGroup
#' }
#' \item{\code{setMaximumOccurs(maximumOccurs)}}{
#' Sets the maximum occurs, object of class \code{integer}
#' }
#' \item{\code{addParameter(parameter)}}{
#' Adds a parameter or parameter group, object of class \code{GMLOperationParameter}
#' or \code{GMLOperationParameterGroup}
#' }
#' \item{\code{delParameter(parameter)}}{
#' Deletes a parameter or parameter group, object of class \code{GMLOperationParameter}
#' or \code{GMLOperationParameterGroupo}
#' }
#' }
#'
#' @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>
#'
GMLOperationParameterGroup <- R6Class("GMLOperationParameterGroup",
inherit = GMLAbstractGeneralOperationParameter,
private = list(
xmlElement = "OperationParameterGroup",
xmlNamespacePrefix = "GML"
),
public = list(

#+ maximumOccurs [0..1]: integer
maximumOccurs = NULL,
#+ parameter [2..*]: GMLOperationParameter / GMLOperationParameterGroup
parameter = list(),

#setMaximumOccurs
setMaximumOccurs = function(maximumOccurs){
if(!is(maximumOccurs, "integer")){
maximumOccurs <- as.integer(maximumOccurs)
if(is.na(maximumOccurs)){
stop("The argument value should be an object of class 'integer'")
}
}
self$maximumOccurs <- GMLElement$create("maximumOccurs", value = maximumOccurs)
},

#addParameter
addParameter = function(param){
if(!inherits(param, "GMLAbstractGeneralOperationParameter")){
stop("The argument value should be an object of class 'GMLOperationParameter' or 'GMLOperationParameterGroup'")
}
return(self$addListElement("parameter", GMLElement$create("parameter", value = param)))
},

#delParameter
delParameter = function(param){
if(!inherits(param, "GMLAbstractGeneralOperationParameter")){
stop("The argument value should be an object of class 'GMLOperationParameter' or 'GMLOperationParameterGroup'")
}
return(self$delListElement("parameter", GMLElement$create("parameter", value = param)))
}

)
)
52 changes: 52 additions & 0 deletions man/GMLAbstractGeneralOperationParameter.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/GMLAbstractGeneralOperationParameter.R
\docType{class}
\name{GMLAbstractGeneralOperationParameter}
\alias{GMLAbstractGeneralOperationParameter}
\title{GMLAbstractGeneralOperationParameter}
\format{\code{\link{R6Class}} object.}
\usage{
GMLAbstractGeneralOperationParameter
}
\value{
Object of \code{\link{R6Class}} for modelling an GMLAbstractGeneralOperationParameter
}
\description{
GMLAbstractGeneralOperationParameter
}
\section{Fields}{

\describe{
\item{\code{minimumOccurs}}{}
}}
\section{Inherited methods from \code{GMLDefinition}}{

}

\section{Methods}{

\describe{
\item{\code{new(xml, defaults, id)}}{
This method is used to instantiate a GML AbstractGeneralOperationParameter
}
\item{\code{setMinimumOccurs(minimumOccurs)}}{
Sets the minimum occurs, object of class \code{integer}
}
}
}
\author{
Emmanuel Blondel <emmanuel.blondel1@gmail.com>
}
\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
}
\keyword{GML}
\keyword{ISO}
\keyword{abstract}
\keyword{general}
\keyword{operation}
\keyword{parameter}

Loading

0 comments on commit 18acb15

Please sign in to comment.