Skip to content

Commit

Permalink
support SWE DataRecord #187
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Sep 26, 2022
1 parent d85c302 commit c956eb0
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 3 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ export(SWECategory)
export(SWECategoryRange)
export(SWECount)
export(SWECountRange)
export(SWEDataRecord)
export(SWEQuantity)
export(SWEQuantityRange)
export(SWEText)
Expand Down
50 changes: 50 additions & 0 deletions R/SWEDataRecord.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#' SWEDataRecord
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO SWE
#' @return Object of \code{\link{R6Class}} for modelling an SWE data record
#' @format \code{\link{R6Class}} object.
#'
#' @note Class used internally by geometa
#'
#' @references
#' SWE Common Data Model Encoding Standard. https://www.ogc.org/standards/swecommon
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
SWEDataRecord <- R6Class("SWEDataRecord",
inherit = SWEAbstractDataComponent,
private = list(
xmlElement = "DataRecord",
xmlNamespacePrefix = "SWE"
),
public = list(
#'@field field field
field = list(),

#'@description Initializes an object of class \link{SWEDataRecord}
#'@param xml object of class \link{XMLInternalNode-class} from \pkg{XML}
#'@param element element
#'@param updatable updatable
#'@param optional optional
#'@param definition definition
initialize = function(xml = NULL, element = NULL, updatable = NULL, optional = FALSE, definition = NULL){
if(is.null(element)) element <- private$xmlElement
super$initialize(xml, element = element, updatable = updatable, optional = optional, definition = definition)
},

#'@description Adds field
#'@param field field
addField = function(field){
return(self$addListElement("field", field))
},

#'@description Deletes field
#'@param field field
delField = function(field){
return(self$delListElement("field", field))
}
)
)
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 @@ -490,7 +490,7 @@
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","CountRange","SWECountRange",TRUE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","DataArray","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","DataChoice","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","DataRecord","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","DataRecord","SWEDataRecord",TRUE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","DataStream","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Matrix","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","NilValues","<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",11,19,36.67
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE",12,18,40
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/-37%25-ff0c0c.svg)](https://github.com/eblondel/geometa) | 11| 19|
|SWE 2.0 |Sensor Web Enablement (SWE) Common Data Model |SWE |[![SWE 2.0](https://img.shields.io/badge/-40%25-f9ae2c.svg)](https://github.com/eblondel/geometa) | 12| 18|
49 changes: 49 additions & 0 deletions man/SWEDataRecord.Rd

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

0 comments on commit c956eb0

Please sign in to comment.