From 614c1c4a0b59cacd42a76ac39c0ca06930ac54b6 Mon Sep 17 00:00:00 2001 From: eblondel Date: Mon, 9 May 2022 17:42:48 +0200 Subject: [PATCH] #187 add AbstractSimpleComponent + test geometa coverage with SWE --- NAMESPACE | 1 + R/SWEAbstractSimpleComponent.R | 34 +++++++++++++++++++ .../coverage/geometa_coverage_inventory.csv | 3 +- .../coverage/geometa_coverage_summary.csv | 4 +-- .../coverage/geometa_coverage_summary.md | 2 +- man/SWEAbstractSimpleComponent.Rd | 34 +++++++++++++++++++ 6 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 R/SWEAbstractSimpleComponent.R create mode 100644 man/SWEAbstractSimpleComponent.Rd diff --git a/NAMESPACE b/NAMESPACE index e1a1a5d4..5c52d08b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -321,6 +321,7 @@ export(ISOVectorSpatialRepresentation) export(ISOVerticalExtent) export(SWEAbstractDataComponent) export(SWEAbstractObject) +export(SWEAbstractSimpleComponent) export(cacheISOClasses) export(convert_metadata) export(geometaLogger) diff --git a/R/SWEAbstractSimpleComponent.R b/R/SWEAbstractSimpleComponent.R new file mode 100644 index 00000000..22b05cd4 --- /dev/null +++ b/R/SWEAbstractSimpleComponent.R @@ -0,0 +1,34 @@ +#' SWEAbstractSimpleComponent +#' +#' @docType class +#' @importFrom R6 R6Class +#' @export +#' @keywords ISO SWE +#' @return Object of \code{\link{R6Class}} for modelling an SWS Abstract simple component +#' @format \code{\link{R6Class}} object. +#' +#' @references +#' OGC Geography Markup Language. https://www.ogc.org/standards/swecommon +#' +#' @author Emmanuel Blondel +#' +SWEAbstractSimpleComponent <- R6Class("SWEAbstractSimpleComponent", + inherit = SWEAbstractDataComponent, + private = list( + xmlElement = "AbstractSimpleComponent", + xmlNamespacePrefix = "SWE" + ), + public = list( + + #'@description Initializes an object of class \link{SWEAbstractSimpleComponent} + #'@param xml object of class \link{XMLInternalNode-class} from \pkg{XML} + #'@param element element + #'@param attrs attrs + #'@param defaults defaults + #'@param wrap wrap + initialize = function(xml = NULL, element = NULL, attrs = list(), defaults = list(), wrap = TRUE){ + if(is.null(element)) element <- private$xmlElement + super$initialize(xml, element = element, attrs = attrs, defaults = defaults, wrap = wrap) + } + ) +) \ No newline at end of file diff --git a/inst/extdata/coverage/geometa_coverage_inventory.csv b/inst/extdata/coverage/geometa_coverage_inventory.csv index 14f65563..de8a67f1 100644 --- a/inst/extdata/coverage/geometa_coverage_inventory.csv +++ b/inst/extdata/coverage/geometa_coverage_inventory.csv @@ -275,7 +275,6 @@ "ISO/TC211 19139:2007","Geographic Metadata XML Schema","GMX","UomAlternativeExpression","",FALSE "ISO/TC211 19139:2007","Geographic Metadata XML Schema - Geographic Temporal Schema (GTS)","GTS","TM_PeriodDuration","",FALSE "ISO/TS 19103:2005","Geographic Common extensible markup language","GCO","AbstractObject","ISOAbstractObject",TRUE -"ISO/TS 19103:2005","Geographic Common extensible markup language","GCO","AbstractObject","ISOAbstractObject",TRUE "ISO/TS 19103:2005","Geographic Common extensible markup language","GCO","Angle","ISOAngle",TRUE "ISO/TS 19103:2005","Geographic Common extensible markup language","GCO","Binary","ISOBinary",TRUE "ISO/TS 19103:2005","Geographic Common extensible markup language","GCO","Boolean","ISOBaseBoolean",TRUE @@ -476,7 +475,7 @@ "SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractDataComponent","SWEAbstractDataComponent",TRUE "SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractEncoding","",FALSE "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","",FALSE +"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","",FALSE "SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractSWEIdentifiable","",FALSE "SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AllowedTimes","",FALSE diff --git a/inst/extdata/coverage/geometa_coverage_summary.csv b/inst/extdata/coverage/geometa_coverage_summary.csv index 5f022d07..8bfdcb1c 100644 --- a/inst/extdata/coverage/geometa_coverage_summary.csv +++ b/inst/extdata/coverage/geometa_coverage_summary.csv @@ -4,8 +4,8 @@ "ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI",40,0,100 "ISO/TC211 19119:2005","Geographic Information - Service Metadata","SRV",7,12,36.84 "ISO/TC211 19139:2007","Geographic Metadata XML Schema","GMX",5,62,7.46 -"ISO/TS 19103:2005","Geographic Common extensible markup language","GCO",24,0,100 +"ISO/TS 19103:2005","Geographic Common extensible markup language","GCO",23,0,100 "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",2,28,6.67 +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE",3,27,10 diff --git a/inst/extdata/coverage/geometa_coverage_summary.md b/inst/extdata/coverage/geometa_coverage_summary.md index 58b1cfe9..0cf3b5fb 100644 --- a/inst/extdata/coverage/geometa_coverage_summary.md +++ b/inst/extdata/coverage/geometa_coverage_summary.md @@ -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/-7%25-ad0f0f.svg)](https://github.com/eblondel/geometa) | 2| 28| +|SWE 2.0 |Sensor Web Enablement (SWE) Common Data Model |SWE |[![SWE 2.0](https://img.shields.io/badge/-10%25-ad0f0f.svg)](https://github.com/eblondel/geometa) | 3| 27| diff --git a/man/SWEAbstractSimpleComponent.Rd b/man/SWEAbstractSimpleComponent.Rd new file mode 100644 index 00000000..81bc6c70 --- /dev/null +++ b/man/SWEAbstractSimpleComponent.Rd @@ -0,0 +1,34 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/SWEAbstractSimpleComponent.R +\docType{class} +\name{SWEAbstractSimpleComponent} +\alias{SWEAbstractSimpleComponent} +\title{SWEAbstractSimpleComponent} +\format{ +\code{\link{R6Class}} object. +} +\arguments{ +\item{xml}{object of class \link{XMLInternalNode-class} from \pkg{XML}} + +\item{element}{element} + +\item{attrs}{attrs} + +\item{defaults}{defaults} + +\item{wrap}{wrap} +} +\value{ +Object of \code{\link{R6Class}} for modelling an SWS Abstract simple component +} +\description{ +Initializes an object of class \link{SWEAbstractSimpleComponent} +} +\references{ +OGC Geography Markup Language. https://www.ogc.org/standards/swecommon +} +\author{ +Emmanuel Blondel +} +\keyword{ISO} +\keyword{SWE}