Skip to content

Commit

Permalink
#187 SWE AbstractSWEIdentifiable
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Oct 3, 2022
1 parent e152cb4 commit e8d703f
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 47 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ export(SWEAbstractDataComponent)
export(SWEAbstractEncoding)
export(SWEAbstractObject)
export(SWEAbstractSWE)
export(SWEAbstractSWEIdentifiable)
export(SWEAbstractSimpleComponent)
export(SWECategory)
export(SWECategoryRange)
Expand Down
27 changes: 2 additions & 25 deletions R/SWEAbstractDataComponent.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,15 @@
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
SWEAbstractDataComponent <- R6Class("SWEAbstractDataComponent",
inherit = SWEAbstractObject,
inherit = SWEAbstractSWEIdentifiable,
private = list(
xmlElement = "AbstractDataComponent",
xmlNamespacePrefix = "SWE"
),
public = list(
#'@field description description
description = NULL,
#'@field label label
label = NULL,

#'@field name name
name = list(),
#'@field identifier identifier
identifier = NULL,

#'@description Initializes an object of class \link{SWEAbstractDataComponent}
#'@param xml object of class \link{XMLInternalNode-class} from \pkg{XML}
Expand All @@ -44,18 +39,6 @@ SWEAbstractDataComponent <- R6Class("SWEAbstractDataComponent",
if(!is.null(definition)) self$setAttr("definition", definition)
},

#'@description Set description
#'@param description description
setDescription = function(description){
self$description <- SWEElement$create(element = "description", value = description)
},

#'@description Set label
#'@param label label
setLabel = function(label){
self$label <- SWEElement$create(element = "label", value = label)
},

#'@description Adds name
#'@param name name
#'@param codeSpace codespace
Expand All @@ -70,12 +53,6 @@ SWEAbstractDataComponent <- R6Class("SWEAbstractDataComponent",
delName = function(name, codeSpace = NULL){
name <- GMLCodeType$new(value = name, codeSpace = codeSpace)
return(self$delListElement("name", name))
},

#'@description Set identifier
#'@param identifier identifier
setIdentifier = function(identifier){
self$identifier <- SWEElement$create(element = "identifier", value = identifier)
}
)
)
56 changes: 56 additions & 0 deletions R/SWEAbstractSWEIdentifiable.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#' SWEAbstractSWEIdentifiable
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO SWE
#' @return Object of \code{\link{R6Class}} for modelling an SWE abstract identifiable
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' SWE Common Data Model Encoding Standard. https://www.ogc.org/standards/swecommon
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
SWEAbstractSWEIdentifiable <- R6Class("SWEAbstractSWEIdentifiable",
inherit = SWEAbstractSWE,
private = list(
xmlElement = "AbstractSWEIdentifiable",
xmlNamespacePrefix = "SWE"
),
public = list(

#'@field identifier identifier
identifier = NULL,
#'@field label label
label = NULL,
#'@field description description
description = NULL,

#'@description Initializes a SWE Nil Values object
#'@param xml object of class \link{XMLInternalNode-class} from \pkg{XML}
initialize = function(xml, element = element, attrs = list(), defaults = list(), wrap = TRUE, value_as_field = TRUE){
if(is.null(element)) element <- private$xmlElement
super$initialize(xml, element = element, attrs = attrs, defaults = defaults, wrap = wrap, value_as_field = value_as_field)
},

#'@description Set identifier
#'@param identifier identifier
setIdentifier = function(identifier){
self$identifier <- SWEElement$create(element = "identifier", value = identifier)
},

#'@description Set label
#'@param label label
setLabel = function(label){
self$label <- SWEElement$create(element = "label", value = label)
},

#'@description Set description
#'@param description description
setDescription = function(description){
self$description <- SWEElement$create(element = "description", value = description)
}

)
)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ We thank in advance people that use ``geometa`` for citing it in their work / pu
|GML 3.2.1 (ISO 19136) |Geographic Markup Language |GML |[![GML 3.2.1 (ISO 19136)](https://img.shields.io/badge/-37%25-ff0c0c.svg)](https://github.com/eblondel/geometa) | 63| 106|
|GML 3.2.1 Coverage (OGC GMLCOV) |OGC GML Coverage Implementation Schema |GMLCOV |[![GML 3.2.1 Coverage (OGC GMLCOV)](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa) | 1| 0|
|GML 3.3 Referenceable Grid (OGC GML) |OGC GML Referenceable Grid |GMLRGRID |[![GML 3.3 Referenceable Grid (OGC GML)](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa) | 5| 0|
|SWE 2.0 |Sensor Web Enablement (SWE) Common Data Model |SWE |[![SWE 2.0](https://img.shields.io/badge/-60%25-f2eb24.svg)](https://github.com/eblondel/geometa) | 18| 12|
|SWE 2.0 |Sensor Web Enablement (SWE) Common Data Model |SWE |[![SWE 2.0](https://img.shields.io/badge/-63%25-f2eb24.svg)](https://github.com/eblondel/geometa) | 19| 11|
2 changes: 1 addition & 1 deletion inst/extdata/coverage/geometa_coverage_inventory.csv
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractObject","SWEAbstractObject",TRUE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractSimpleComponent","SWEAbstractSimpleComponent",TRUE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractSWE","SWEAbstractSWE",TRUE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractSWEIdentifiable","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractSWEIdentifiable","SWEAbstractSWEIdentifiable",TRUE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AllowedTimes","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AllowedTokens","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AllowedValues","<missing>",FALSE
Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/coverage/geometa_coverage_summary.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"GML 3.2.1 (ISO 19136)","Geographic Markup Language","GML",63,106,37.28
"GML 3.2.1 Coverage (OGC GMLCOV)","OGC GML Coverage Implementation Schema","GMLCOV",1,0,100
"GML 3.3 Referenceable Grid (OGC GML)","OGC GML Referenceable Grid","GMLRGRID",5,0,100
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE",18,12,60
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE",19,11,63.33
2 changes: 1 addition & 1 deletion inst/extdata/coverage/geometa_coverage_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
|GML 3.2.1 (ISO 19136) |Geographic Markup Language |GML |[![GML 3.2.1 (ISO 19136)](https://img.shields.io/badge/-37%25-ff0c0c.svg)](https://github.com/eblondel/geometa) | 63| 106|
|GML 3.2.1 Coverage (OGC GMLCOV) |OGC GML Coverage Implementation Schema |GMLCOV |[![GML 3.2.1 Coverage (OGC GMLCOV)](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa) | 1| 0|
|GML 3.3 Referenceable Grid (OGC GML) |OGC GML Referenceable Grid |GMLRGRID |[![GML 3.3 Referenceable Grid (OGC GML)](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa) | 5| 0|
|SWE 2.0 |Sensor Web Enablement (SWE) Common Data Model |SWE |[![SWE 2.0](https://img.shields.io/badge/-60%25-f2eb24.svg)](https://github.com/eblondel/geometa) | 18| 12|
|SWE 2.0 |Sensor Web Enablement (SWE) Common Data Model |SWE |[![SWE 2.0](https://img.shields.io/badge/-63%25-f2eb24.svg)](https://github.com/eblondel/geometa) | 19| 11|
18 changes: 0 additions & 18 deletions man/SWEAbstractDataComponent.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions man/SWEAbstractSWEIdentifiable.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e8d703f

Please sign in to comment.