diff --git a/DESCRIPTION b/DESCRIPTION index 3376abd1..2f822ec8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: geometa Type: Package Title: Tools for Reading and Writing ISO/OGC Geographic Metadata -Version: 0.6-7 -Date: 2022-02-14 +Version: 0.7 +Date: 2022-05-05 Authors@R: c(person("Emmanuel", "Blondel", role = c("aut", "cre"), email = "emmanuel.blondel1@gmail.com", comment = c(ORCID = "0000-0002-5870-5762"))) Maintainer: Emmanuel Blondel Description: Provides facilities to handle reading and writing of geographic metadata diff --git a/NAMESPACE b/NAMESPACE index 08958307..e1a1a5d4 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -30,6 +30,7 @@ export(GMLBaseUnit) export(GMLCOVAbstractCoverage) export(GMLCOVExtension) export(GMLCartesianCS) +export(GMLCodeType) export(GMLCompoundCRS) export(GMLConventionalUnit) export(GMLConversion) @@ -318,6 +319,8 @@ export(ISOUnlimitedInteger) export(ISOUsage) export(ISOVectorSpatialRepresentation) export(ISOVerticalExtent) +export(SWEAbstractDataComponent) +export(SWEAbstractObject) export(cacheISOClasses) export(convert_metadata) export(geometaLogger) diff --git a/R/GMLCodeType.R b/R/GMLCodeType.R new file mode 100644 index 00000000..ce17d731 --- /dev/null +++ b/R/GMLCodeType.R @@ -0,0 +1,35 @@ +#' GMLCodeType +#' +#' @docType class +#' @importFrom R6 R6Class +#' @export +#' @keywords GML codetype +#' @return Object of \code{\link{R6Class}} for modelling a GML code type +#' @format \code{\link{R6Class}} object. +#' +#' @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 +#' +GMLCodeType <- R6Class("GMLCodeType", + inherit = ISOAbstractObject, + private = list( + xmlElement = "CodeType", + xmlNamespacePrefix = "GML" + ), + public = list( + value = NA, + attrs = list(), + initialize = function(xml = NULL, value, codeSpace = NULL){ + super$initialize(xml = xml) + if(is.null(xml)){ + self$value = value + self$attrs$codeSpace <- codeSpace + } + } + ) +) \ No newline at end of file diff --git a/R/ISOAbstractGenericName.R b/R/ISOAbstractGenericName.R index 8fea9936..9c488bab 100644 --- a/R/ISOAbstractGenericName.R +++ b/R/ISOAbstractGenericName.R @@ -22,7 +22,7 @@ #' @author Emmanuel Blondel #' ISOAbstractGenericName <- R6Class("ISOAbstractGenericName", - inherit = ISOAbstractObject, + inherit = GMLCodeType, private = list( xmlElement = "AbstractGenericName", xmlNamespacePrefix = "GCO" diff --git a/R/ISOAbstractObject.R b/R/ISOAbstractObject.R index bbf86856..63b9e09e 100644 --- a/R/ISOAbstractObject.R +++ b/R/ISOAbstractObject.R @@ -1368,12 +1368,13 @@ ISOAbstractObject$getStandardByPrefix = function(prefix){ "GFC" = data.frame(specification = "ISO/TC211 19110:2005", title = "Geographic Information - Methodology for feature cataloguing", stringsAsFactors = FALSE), "GMD" = data.frame(specification = "ISO/TC211 19115-1:2003", title = "Geographic Information - Metadata", stringsAsFactors = FALSE), "GMI" = data.frame(specification = "ISO/TC211 19115-2:2009", title = "Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data", stringsAsFactors = FALSE), + "GTS" = data.frame(specification = "ISO/TC211 19139:2007", title = "Geographic Metadata XML Schema - Geographic Temporal Schema (GTS)", stringsAsFactors = FALSE), "SRV" = data.frame(specification = "ISO/TC211 19119:2005", title = "Geographic Information - Service Metadata", stringsAsFactors = FALSE), "GMX" = data.frame(specification = "ISO/TC211 19139:2007", title = "Geographic Metadata XML Schema", stringsAsFactors = FALSE), "GML" = data.frame(specification = "GML 3.2.1 (ISO 19136)", title = "Geographic Markup Language", stringsAsFactors = FALSE), "GMLCOV" = data.frame(specification = "GML 3.2.1 Coverage (OGC GMLCOV)", title = "OGC GML Coverage Implementation Schema", stringsAsFactors = FALSE), "GMLRGRID" = data.frame(specification = "GML 3.3 Referenceable Grid (OGC GML)", title = "OGC GML Referenceable Grid", stringsAsFactors = FALSE), - NA + "SWE" = data.frame(specification = "SWE 2.0", title = "Sensor Web Enablement (SWE) Common Data Model", stringsAsFactors = FALSE) ) return(std) } diff --git a/R/ISOMetadataNamespace.R b/R/ISOMetadataNamespace.R index 3dedf4d5..c892a854 100644 --- a/R/ISOMetadataNamespace.R +++ b/R/ISOMetadataNamespace.R @@ -43,6 +43,7 @@ ISOMetadataNamespace$SRV = ISOMetadataNamespace$new("srv", "http://www.isotc211. ISOMetadataNamespace$GML = ISOMetadataNamespace$new("gml", "http://www.opengis.net/gml/3.2") ISOMetadataNamespace$GMLCOV = ISOMetadataNamespace$new("gmlcov", "http://www.opengis.net/gmlcov/1.0") ISOMetadataNamespace$GMLRGRID = ISOMetadataNamespace$new("gmlrgrid", "http://www.opengis.net/gml/3.3/rgrid") +ISOMetadataNamespace$SWE = ISOMetadataNamespace$new("swe", "http://www.opengis.net/swe/2.0") ISOMetadataNamespace$XLINK = ISOMetadataNamespace$new("xlink", "http://www.w3.org/1999/xlink") ISOMetadataNamespace$XSI = ISOMetadataNamespace$new("xsi", "http://www.w3.org/2001/XMLSchema-instance") @@ -60,8 +61,9 @@ setISOMetadataNamespaces <- function(){ ISOMetadataNamespace$GML, ISOMetadataNamespace$GMLCOV, ISOMetadataNamespace$GMLRGRID, + ISOMetadataNamespace$SWE, ISOMetadataNamespace$XLINK, - ISOMetadataNamespace$XSI + ISOMetadataNamespace$XSI ) } diff --git a/R/SWEAbstractDataComponent.R b/R/SWEAbstractDataComponent.R new file mode 100644 index 00000000..0e921329 --- /dev/null +++ b/R/SWEAbstractDataComponent.R @@ -0,0 +1,80 @@ +#' SWEAbstractDataComponent +#' +#' @docType class +#' @importFrom R6 R6Class +#' @export +#' @keywords ISO SWE +#' @return Object of \code{\link{R6Class}} for modelling an SWS Abstract data component +#' @format \code{\link{R6Class}} object. +#' +#' @note Class used internally by geometa +#' +#' @references +#' OGC Geography Markup Language. https://www.ogc.org/standards/swecommon +#' +#' @author Emmanuel Blondel +#' +SWEAbstractDataComponent <- R6Class("SWEAbstractDataComponent", + inherit = SWEAbstractObject, + private = list( + xmlElement = "AbstractDataComponent", + xmlNamespacePrefix = "SWE" + ), + public = list( + #'@field definition definition + definition = NULL, + #'@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{SWSAbstractDataComponent} + #'@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) + }, + + #'@description Set definition + #'@param definition definition + setDefinition = function(definition){ + self$definition <- definition + }, + + #'@description Set description + #'@param description description + setDescription = function(description){ + self$description <- description + }, + + #'@description Adds name + #'@param name name + #'@param codeSpace codespace + addName = function(name, codeSpace = NULL){ + name <- GMLCodeType$new(value = name, codeSpace = codeSpace) + return(self$addListElement("name", name)) + }, + + #'@description Deletes name + #'@param name name + #'@param codeSpace codespace + 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 <- identifier + } + ) +) \ No newline at end of file diff --git a/R/SWEAbstractObject.R b/R/SWEAbstractObject.R new file mode 100644 index 00000000..aa53ea07 --- /dev/null +++ b/R/SWEAbstractObject.R @@ -0,0 +1,35 @@ +#' SWEAbstractObject +#' +#' @docType class +#' @importFrom R6 R6Class +#' @export +#' @keywords ISO GML +#' @return Object of \code{\link{R6Class}} for modelling an GML abstract object +#' @format \code{\link{R6Class}} object. +#' +#' @note Class used internally by geometa +#' +#' @author Emmanuel Blondel +#' +SWEAbstractObject <- R6Class("SWEAbstractObject", + inherit = ISOAbstractObject, + private = list( + xmlElement = "AbstractObject", + xmlNamespacePrefix = "SWE" + ), + public = list( + + #'@description Initializes an object of class \link{SWEAbstractObject} + #'@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 = FALSE){ + if(is.null(element)) element <- private$xmlElement + super$initialize(xml, element, namespace = private$xmlNamespacePrefix, + attrs = attrs, defaults = defaults, + wrap = wrap) + } + ) +) \ No newline at end of file diff --git a/R/geometa_coverage.R b/R/geometa_coverage.R index 3a18e1e1..43f6dffa 100644 --- a/R/geometa_coverage.R +++ b/R/geometa_coverage.R @@ -255,7 +255,8 @@ geometa_coverage <- function(){ elements <- elements[with(elements,order(specification, ns_prefix, element)),c("specification", "title", "ns_prefix", "element", "geometa_class", "in_geometa")] elements <- rbind( elements[startsWith(elements$specification, "ISO"),], - elements[startsWith(elements$specification, "GML"),] + elements[startsWith(elements$specification, "GML"),], + elements[startsWith(elements$specification, "SWE"),] ) elements <- elements[!is.na(elements$specification),] return(elements) diff --git a/inst/extdata/coverage/coverage.R b/inst/extdata/coverage/coverage.R index 4839c2da..929feb06 100644 --- a/inst/extdata/coverage/coverage.R +++ b/inst/extdata/coverage/coverage.R @@ -26,7 +26,8 @@ row.names(cov_summary) <- cov_summary$Standard cov_summary <- rbind( cov_summary[startsWith(cov_summary$Standard, "ISO"),], - cov_summary[startsWith(cov_summary$Standard, "GML"),] + cov_summary[startsWith(cov_summary$Standard, "GML"),], + cov_summary[startsWith(cov_summary$Standard, "SWE"),] ) cov_summary$coverage_class <- NULL write.csv(cov_summary, file = file.path(getwd(), "inst/extdata/coverage/geometa_coverage_summary.csv"), diff --git a/inst/extdata/coverage/geometa_coverage_inventory.csv b/inst/extdata/coverage/geometa_coverage_inventory.csv index c20c2e2e..14f65563 100644 --- a/inst/extdata/coverage/geometa_coverage_inventory.csv +++ b/inst/extdata/coverage/geometa_coverage_inventory.csv @@ -273,10 +273,13 @@ "ISO/TC211 19139:2007","Geographic Metadata XML Schema","GMX","OperationParameterAlt","",FALSE "ISO/TC211 19139:2007","Geographic Metadata XML Schema","GMX","PrimeMeridianAlt","",FALSE "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 +"ISO/TS 19103:2005","Geographic Common extensible markup language","GCO","Boolean","ISOBaseBoolean",TRUE "ISO/TS 19103:2005","Geographic Common extensible markup language","GCO","CharacterString","ISOBaseCharacterString",TRUE "ISO/TS 19103:2005","Geographic Common extensible markup language","GCO","Date","ISOBaseDate",TRUE "ISO/TS 19103:2005","Geographic Common extensible markup language","GCO","DateTime","ISOBaseDateTime",TRUE @@ -470,3 +473,33 @@ "GML 3.3 Referenceable Grid (OGC GML)","OGC GML Referenceable Grid","GMLRGRID","ReferenceableGridByArray","GMLReferenceableGridByArray",TRUE "GML 3.3 Referenceable Grid (OGC GML)","OGC GML Referenceable Grid","GMLRGRID","ReferenceableGridByTransformation","GMLReferenceableGridByTransformation",TRUE "GML 3.3 Referenceable Grid (OGC GML)","OGC GML Referenceable Grid","GMLRGRID","ReferenceableGridByVectors","GMLReferenceableGridByVectors",TRUE +"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","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 +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AllowedTokens","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AllowedValues","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","BinaryEncoding","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Block","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Category","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","CategoryRange","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Component","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Count","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","CountRange","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","DataArray","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","DataChoice","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","DataRecord","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","DataStream","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Matrix","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","NilValues","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Quantity","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","QuantityRange","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Text","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","TextEncoding","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Time","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","TimeRange","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Vector","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","XMLEncoding","",FALSE diff --git a/inst/extdata/coverage/geometa_coverage_summary.csv b/inst/extdata/coverage/geometa_coverage_summary.csv index 3d2fa12c..5f022d07 100644 --- a/inst/extdata/coverage/geometa_coverage_summary.csv +++ b/inst/extdata/coverage/geometa_coverage_summary.csv @@ -3,8 +3,9 @@ "ISO/TC211 19115-1:2003","Geographic Information - Metadata","GMD",132,0,100 "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,61,7.58 -"ISO/TS 19103:2005","Geographic Common extensible markup language","GCO",22,0,100 +"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 "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 diff --git a/inst/extdata/schemas/gmd/gmd.xsd b/inst/extdata/schemas/gmd/gmd.xsd index 0e82ff5e..ea89e0c3 100644 --- a/inst/extdata/schemas/gmd/gmd.xsd +++ b/inst/extdata/schemas/gmd/gmd.xsd @@ -14,6 +14,8 @@ + + diff --git a/inst/extdata/schemas/sweCommon/ReadMe.txt b/inst/extdata/schemas/sweCommon/ReadMe.txt new file mode 100644 index 00000000..f382d385 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/ReadMe.txt @@ -0,0 +1,62 @@ +OGC(r) SWE Common schema - ReadMe.txt +========================================= + +OGC(r) Sensor Web Enablement (SWE) Common Data Model +----------------------------------------------------------------------- + +The Sensor Web Enablement (SWE) Common Data Model Encoding Standard +defines low level data models for exchanging sensor related data +between nodes of the OGC Sensor Web Enablement (SWE) framework. These +models allow applications and/or servers to structure, encode and +transmit sensor datasets in a self describing and semantically enabled +way. + +More information may be found at + http://www.opengeospatial.org/standards/swecommon + +The most current schema are available at http://schemas.opengis.net/ . + +----------------------------------------------------------------------- + +2012-07-21 Kevin Stegemoller + * v1.0 - v2.0: WARNING XLink change is NOT BACKWARD COMPATIBLE. + * Changed OGC XLink (xlink:simpleLink) to W3C XLink (xlink:simpleAttrs) + per an approved TC and PC motion during the Dec. 2011 Brussels meeting. + See http://www.opengeospatial.org/blog/1597 + * v1.0 - v2.0: Per 11-025, all leaf documents of a namespace shall retroactively + and explicitly require/add an of the all-components schema. + * v1.0 - v2.0: Included swe.xsd as the all-components document (06-135r11 #14) + * v1.0.0: Updated xsd:schema/@version to 1.0.0.2 (06-135r11 s#13.4) + * v1.0.1: Updated xsd:schema/@version to 1.0.1.2 (06-135r11 s#13.4) + * v2.0: Updated xsd:schema/@version to 2.0.1 (06-135r11 s#13.4) + +2011-01-06 Alexandre Robin + * v2.0.0: Published sweCommon/2.0 from OGC 08-094r1 + +2010-02-01 Kevin Stegemoller + * v1.0.1, v1.0.0: + + Updated xsd:schema/@version attribute (06-135r7 s#13.4) + + Update relative schema imports to absolute URLs (06-135r7 s#15) + + Update/verify copyright (06-135r7 s#3.2) + + Add archives (.zip) files of previous versions + + Create/update ReadMe.txt (06-135r7 s#17) + +2007-11-12 Kevin Stegemoller + * v1.0.1: Published sweCommon/1.0.1 from OGC 07-000 + 07-122r2 + * v1.0.1: Added copyright statement + * v1.0.1: Minor documentation changes + * See ChangeLog.txt for additional details + +2007-07-25 Mike Botts + * Released sensorML 1.0.0 (OGC 07-000), ic 2.0 and sweCommon 1.0.0 (from OGC 07-000) + * SensorML/1.0.0 (OGC 07-000) references ic/2.0 and sweCommon/1.0.0 (from OGC 07-000) + * See ChangeLog.txt for additional details + +----------------------------------------------------------------------- + +Policies, Procedures, Terms, and Conditions of OGC(r) are available + http://www.opengeospatial.org/ogc/legal/ . + +Copyright (c) 2011 Open Geospatial Consortium. + +----------------------------------------------------------------------- diff --git a/inst/extdata/schemas/sweCommon/advanced_encodings.sch b/inst/extdata/schemas/sweCommon/advanced_encodings.sch new file mode 100644 index 00000000..abfa1fa1 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/advanced_encodings.sch @@ -0,0 +1,27 @@ + + + + Additional validation rules for XML instances including advanced encodings + + + + Req 80 + + + When base64 binary encoding is specified, values shall be base64 encoded (Req 80) + + + When binary encoding is used, the values element shall not contain sub-elements (Req 80) + + + + + When raw binary encoding is specified, encoded data block shall be out of band and referenced by xlink:href (Req 80) + + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/advanced_encodings.xsd b/inst/extdata/schemas/sweCommon/advanced_encodings.xsd new file mode 100644 index 00000000..f60fb038 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/advanced_encodings.xsd @@ -0,0 +1,186 @@ + + + SWE Common Data Model schema for specifying parameters of advanced encoding methods (Raw Binary, Base64 Binary, Compressed Binary). See requirements class http://www.opengis.net/spec/SWE/2.0/req/xsd-advanced-encodings/ + + SWE Common is an OGC Standard. + Copyright (c) 2010 Open Geospatial Consortium. + To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ . + + + + + + + + Binary encoding parameters used to encode a block of values at once. This is used for encrypting or compressing a complete array of values for instance + + + + + + + + Name of the compression method used to encrypt the block of values described by the referenced data component + + + + + Name of the encryption method used to encrypt the block of values described by the referenced data component + + + + + Number of padding bytes present in the stream after this binary block + + + + + Number of padding bytes present in the stream before this binary block + + + + + Length in byte of this binary block (if known in advance) + + + + + Reference to the aggregate data component that this binary block encoding settings apply to + + + + + + + + + + + + + + + + + + + Parameters of the binary encoding method + + + + + + + + + Each member contains detailed parameters for encoding a scalar value or a block of values + + + + + + + + + + + Byte order convention used to encode this binary data (big endian = most significant byte first, MSB or little endian = least significant byte first, LSB) + + + + + Byte encoding method used to encode the binary data (raw or base 64) + + + + + Total length in bytes of the binary stream (if known in advance) + + + + + + + + + + + + + + + + + + + Binary encoding parameters used for encoding a single data component + + + + + + + + Name of the encryption method used to encrypt the value of this field + + + + + Number of significant bits actually used for a binary encoded numerical value (all remaining bits shall be set to 0) + + + + + + Byte length of this field when a custom data type is used + + + + + Binary data type used to encode the value(s) of the referenced data component + + + + + Reference to the data component that these binary encoding settings apply to + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/basic_types.xsd b/inst/extdata/schemas/sweCommon/basic_types.xsd new file mode 100644 index 00000000..40d2b476 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/basic_types.xsd @@ -0,0 +1,147 @@ + + + Schema of simple basic types used in various places in the SWE Common Data Model. + + SWE Common is an OGC Standard. + Copyright (c) 2010 Open Geospatial Consortium. + To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ . + + + + + + + + Base substitution groups for all SWE Common objects other than value objects + + + + + + + Extension slot for future extensions to this standard. + + + + + + + + + Base substitution groups for all SWE Common objects with identification metadata + + + + + + + + + Unique identifier of the data component. It can be used to globally identify a particular component of the dataset, a process input/output or a universal constant + + + + + Textual label for the data component . This is often used for displaying a human readable name for a dataset field or a process input/output + + + + + Textual description (i.e. human readable) of the data component usually used to clarify its nature + + + + + + + + + + + + + + This type specifies a character string of length at least one, and restricted such that it must not contain any of the following characters: ":" (colon), " " (space), (newline), (carriage return), (tab). This allows values corresponding to familiar abbreviations, such as "kg", "m/s", etc. +It is also required that the symbol be an identifier for a unit of measure as specified in the "Unified Code of Units of Measure" (UCUM) (http://aurora.regenstrief.org/UCUM). This provides a set of symbols and a grammar for constructing identifiers for units of measure that are unique, and may be easily entered with a keyboard supporting the limited character set known as 7-bit ASCII. ISO 2955 formerly provided a specification with this scope, but was withdrawn in 2001. UCUM largely follows ISO 2955 with modifications to remove ambiguities and other problems. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "now" indicates that the specified value shall be replaced with the current temporal position whenever the value is accessed. + + + + + + + + + + + + + + + diff --git a/inst/extdata/schemas/sweCommon/block_components.sch b/inst/extdata/schemas/sweCommon/block_components.sch new file mode 100644 index 00000000..7882de3d --- /dev/null +++ b/inst/extdata/schemas/sweCommon/block_components.sch @@ -0,0 +1,34 @@ + + + + Additional validation rules for XML instances including block data components + + + Req 49 + + + Components that are children of a block component shall never have inline values (Req 49) + + + + + Req 50 + + + Block components containing block encoded values shall also specify an encoding method (Req 50) + + + + + Req 51 + + + The element type of a Matrix shall be a nested Matrix or a scalar numerical component (Req 51) + + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/block_components.xsd b/inst/extdata/schemas/sweCommon/block_components.xsd new file mode 100644 index 00000000..6d757e70 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/block_components.xsd @@ -0,0 +1,163 @@ + + + SWE Common Data Model schema for data arrays and data stream descriptors. See requirements class http://www.opengis.net/spec/SWE/2.0/req/xsd-block-components/ + + SWE Common is an OGC Standard. + Copyright (c) 2010 Open Geospatial Consortium. + To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ . + + + + + + + + + Implementation of ISO-11404 Array datatype. This defines an array of identical data components with a elementCount. Values are given as a block and can be encoded in different ways + + + + + + + + + Specifies the size of the array (i.e. the number of elements of the defined type it contains) + + + + + Defines the structure of the element that will be repeated in the array + + + + + + + + + + + + Specifies the type of method used to encode the array values + + + + + + + + + + If present, contains an encoded block of the values contained in the array. Values are optional so that the array definition can be used a as a schema for values provided externally + + + + + + + + + + + + + + + + + + + + Implementation of ISO-11404 Array datatype. This defines an array of identical data components with a elementCount. Values are given as a block and can be encoded in different ways + + + + + + + + Frame of reference (usually spatial) with respect to which the coordinates of this matrix are expressed + + + + + Frame of reference whose origin is located by the transformation defined by this matrix + + + + + + + + + + + + + + + + + + + Defines the structure of the element that will be repeated in the stream + + + + + + + + + Number of elements of the defined type that the stream contains + + + + + + + + + + Definition and structure of one stream element + + + + + + + + + + + + Method used to encode the stream values + + + + + + + + + + Encoded values for the stream (can be out of band) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/choice_components.sch b/inst/extdata/schemas/sweCommon/choice_components.sch new file mode 100644 index 00000000..64a329f1 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/choice_components.sch @@ -0,0 +1,18 @@ + + + + Additional validation rules for XML instances including choice data components + + + Req 46 + + + Item names shall be unique within the 'DataChoice' component (Req 46) + + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/choice_components.xsd b/inst/extdata/schemas/sweCommon/choice_components.xsd new file mode 100644 index 00000000..01bece54 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/choice_components.xsd @@ -0,0 +1,56 @@ + + + SWE Common Data Model schema for choice data components (i.e. disjoint unions). See requirements class http://www.opengis.net/spec/SWE/2.0/req/xsd-choice-components/ + + SWE Common is an OGC Standard. + Copyright (c) 2010 Open Geospatial Consortium. + To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ . + + + + + + + + Implementation of a choice of two or more Data Components (also called disjoint union) + + + + + + + + + This category component marks the data stream element that will indicate the actual choice made. Possible choices are listed in the Category constraint section as an enumeration and should map to item names. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/examples/image_data.xml b/inst/extdata/schemas/sweCommon/examples/image_data.xml new file mode 100644 index 00000000..73b5f1d1 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/image_data.xml @@ -0,0 +1,70 @@ + + + + + + + + 3000 + + + + + + + 3000 + + + + + + + Radiance measured on band1 usually assigned to red channel + + + 0 + 255 + + + + + + + Radiance measured on band2 usually assigned to green channel + + + + + + Radiance measured on band3 usually assigned to blue channel + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/image_data_with_security_extension.xml b/inst/extdata/schemas/sweCommon/examples/image_data_with_security_extension.xml new file mode 100644 index 00000000..50e32fdf --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/image_data_with_security_extension.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + 3000 + + + + + + + 3000 + + + + + + + Radiance measured on band1 usually assigned to red channel + + + 0 + 255 + + + + + + + Radiance measured on band2 usually assigned to green channel + + + + + + Radiance measured on band3 usually assigned to blue channel + + + + + + + + + + + + + + + + + + + + + + + + + AbCD0123FgI= + diff --git a/inst/extdata/schemas/sweCommon/examples/nav_data.xml b/inst/extdata/schemas/sweCommon/examples/nav_data.xml new file mode 100644 index 00000000..f546bef4 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/nav_data.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2009-01-01T10:00:25Z,25.3,1098,5,56 + 2009-01-01T10:00:35Z,25.4,1098,15,59 + 2009-01-01T10:00:45Z,25.4,1098,12,42 + 2009-01-01T10:00:55Z,25.4,1098,5,40 + 2009-01-01T10:01:05Z,25.3,1098,5,66 + + diff --git a/inst/extdata/schemas/sweCommon/examples/security.xsd b/inst/extdata/schemas/sweCommon/examples/security.xsd new file mode 100644 index 00000000..10e8c21d --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/security.xsd @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/array_image_band_interleaved.xml b/inst/extdata/schemas/sweCommon/examples/spec/array_image_band_interleaved.xml new file mode 100644 index 00000000..4d32963c --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/array_image_band_interleaved.xml @@ -0,0 +1,75 @@ + + + + + + + 3000 + + + + + + + 3000 + + + + + Radiance measured on band1 + + + + + + + + + + + + 3000 + + + + + + + 3000 + + + + + Radiance measured on band2 + + + + + + + + + + + + 3000 + + + + + + + 3000 + + + + + Radiance measured on band3 + + + + + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/array_image_pixel_interleaved.xml b/inst/extdata/schemas/sweCommon/examples/spec/array_image_pixel_interleaved.xml new file mode 100644 index 00000000..19f44261 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/array_image_pixel_interleaved.xml @@ -0,0 +1,39 @@ + + + + + 3000 + + + + + + + 3000 + + + + + + + Radiance measured on band1 + + + + + + Radiance measured on band2 + + + + + + Radiance measured on band3 + + + + + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/array_trajectory.xml b/inst/extdata/schemas/sweCommon/examples/spec/array_trajectory.xml new file mode 100644 index 00000000..03ca1509 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/array_trajectory.xml @@ -0,0 +1,25 @@ + + + Trajectory + + + + + + Location Point + + + Latitude + + + + + + Longitude + + + + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/array_weather.xml b/inst/extdata/schemas/sweCommon/examples/spec/array_weather.xml new file mode 100644 index 00000000..d0e61cd0 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/array_weather.xml @@ -0,0 +1,42 @@ + + + Array of synchronous weather measurements + + + 5 + + + + + Weather Data Record + + + Sampling Time + + + + + + Air Temperature + + + + + + Atmospheric Pressure + + + + + + + + + + 2009-02-10T10:42:56Z,25.4,1020 + 2009-02-10T10:43:06Z,25.3,1021 + 2009-02-10T10:44:16Z,25.3,1020 + 2009-02-10T10:45:26Z,25.4,1022 + 2009-02-10T10:46:36Z,25.4,1022 + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/choice_stream.xml b/inst/extdata/schemas/sweCommon/examples/spec/choice_stream.xml new file mode 100644 index 00000000..3d7861aa --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/choice_stream.xml @@ -0,0 +1,36 @@ + + + + + + Temperature Measurement + + + + + + + + + + + + + + + + Pressure Measurement + + + + + + + + + + + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/constraints.xml b/inst/extdata/schemas/sweCommon/examples/spec/constraints.xml new file mode 100644 index 00000000..1186874e --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/constraints.xml @@ -0,0 +1,91 @@ + + + + + + Instrument Type + + + + Multi beam echosounder + Temperature sensor + Underwater camera + + + + + + + + Model Number + + + ^[0-9][A-Z]{3}[0-9]{2}S1$ + + + + + + + + Wind Speed + + + + 0 250 + + + + + + + + Planar Angle + + + + -180 +180 + + + + + + + + + + + -INF -20 + 20 50 + 60 INF + + + + + + + + Image Width + + + 256 + 512 + 1024 + + + + + + + + Acquisition Time + + + + 2009-01-01 INF + + + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/datastream_with_quality.xml b/inst/extdata/schemas/sweCommon/examples/spec/datastream_with_quality.xml new file mode 100644 index 00000000..bce815c6 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/datastream_with_quality.xml @@ -0,0 +1,33 @@ + + + + + + + + + Water Pressure + Water pressure measured by CTD + + + + + + + + QC Flag + + + + + + + + + + + + + 10.2,pass + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/enc_binary_image.xml b/inst/extdata/schemas/sweCommon/examples/spec/enc_binary_image.xml new file mode 100644 index 00000000..ea674635 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/enc_binary_image.xml @@ -0,0 +1,53 @@ + + + + + 256 + + + + + + + 256 + + + + + + + Radiance count on band1 + + + + + Radiance count on band2 + + + + + Radiance count on band3 + + + + + + + + + + + + + + + + + + + FZEFZE564864HGZ6RG54Z684F86R7H4Z84FR8Z4685E468GTA4E8G4A6 + + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/enc_text_choice_stream.xml b/inst/extdata/schemas/sweCommon/examples/spec/enc_text_choice_stream.xml new file mode 100644 index 00000000..f3465e72 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/enc_text_choice_stream.xml @@ -0,0 +1,53 @@ + + + + + + + Temperature Measurement + + + + + + + + + + + + + + + + Wind Measurement + + + + + + + + + + + + + + + + + + + + + + + + + TEMP,2009-05-23T19:36:15Z,25.5 + TEMP,2009-05-23T19:37:15Z,25.6 + WIND,2009-05-23T19:37:17Z,56.3,226.3 + TEMP,2009-05-23T19:38:15Z,25.5 + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/enc_text_curve.xml b/inst/extdata/schemas/sweCommon/examples/spec/enc_text_curve.xml new file mode 100644 index 00000000..a6f2cbeb --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/enc_text_curve.xml @@ -0,0 +1,31 @@ + + + Measurement error vs. temperature + + + 5 + + + + + Error vs. Temperature + + + Temperature + + + + + + Relative Error + + + + + + + + + 0,5 10,2 50,2 80,5 100,15 + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/enc_text_nav_options.xml b/inst/extdata/schemas/sweCommon/examples/spec/enc_text_nav_options.xml new file mode 100644 index 00000000..2bf51f83 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/enc_text_nav_options.xml @@ -0,0 +1,64 @@ + + + Aircraft Navigation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2007-10-23T15:46:12Z + 15.3 + + 45.3 + -90.5 + 311 + + + + 2007-10-23T15:46:22Z + 25.3 + + + 2007-10-23T15:46:32Z + 20.6 + + 45.3 + -90.6 + 312 + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/enc_text_profile_series.xml b/inst/extdata/schemas/sweCommon/examples/spec/enc_text_profile_series.xml new file mode 100644 index 00000000..3033b9dd --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/enc_text_profile_series.xml @@ -0,0 +1,45 @@ + + + + + + + Sampling Time + + + + + + + + + + + + + Sampling Point Vertical Location + + + + + + Salinity + + + + + + + + + + + + + + 2005-05-16T21:47:12Z,5,0,45,10,20,20,30,30,35,40,40@@ + 2005-05-16T22:43:05Z,4,0,45,10,20,20,30,30,35@@ + 2005-05-16T23:40:52Z,5,0,45,10,20,20,30,30,35,40,40@@ + 2005-05-17T00:45:22Z,6,0,45,10,20,20,30,30,35,40,40,50,45 + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/enc_text_stress_matrix.xml b/inst/extdata/schemas/sweCommon/examples/spec/enc_text_stress_matrix.xml new file mode 100644 index 00000000..a2c8f5c0 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/enc_text_stress_matrix.xml @@ -0,0 +1,26 @@ + + + + + 3 + + + + + + + 3 + + + + + + + + + + + + + 0.36,0.48,-0.8 -0.8,0.6,0.0 0.48,0.64,0.6 + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/enc_xml_curve.xml b/inst/extdata/schemas/sweCommon/examples/spec/enc_xml_curve.xml new file mode 100644 index 00000000..e90f5ef8 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/enc_xml_curve.xml @@ -0,0 +1,52 @@ + + + Measurement error vs. temperature + + + 5 + + + + + Error vs. Temperature + + + Temperature + + + + + + Relative Error + + + + + + + + + + + 0 + 5 + + + 10 + 2 + + + 50 + 2 + + + 80 + 5 + + + 100 + 15 + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/enc_xml_profile_series.xml b/inst/extdata/schemas/sweCommon/examples/spec/enc_xml_profile_series.xml new file mode 100644 index 00000000..7db346bb --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/enc_xml_profile_series.xml @@ -0,0 +1,88 @@ + + + + + + + Sampling Time + + + + + + + + + + + + + Sampling Point Vertical Location + + + + + + Salinity + + + + + + + + + + + + + + + 2005-05-16T21:47:12Z + + + 0 + 45 + + + 10 + 20 + + + 20 + 30 + + + 30 + 35 + + + 40 + 40 + + + + + 2005-05-16T22:43:05Z + + + 0 + 45 + + + 10 + 20 + + + 20 + 30 + + + 30 + 35 + + + + ... + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/encoding_text.xml b/inst/extdata/schemas/sweCommon/examples/spec/encoding_text.xml new file mode 100644 index 00000000..a7a2bab2 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/encoding_text.xml @@ -0,0 +1,21 @@ + + + + + 25.41,10.23,320 25.43,10.23,300 25.39,11.51,310 + + + 25.41,10.23,320 + 25.43,10.23,300 + 25.39,11.51,310 + + + 25.41||text with spaces||text with + carriage return||{special_chars}@ + 25.42||text with spaces||text with + carriage return||{special_chars}@ + 25.43||text with spaces||text with + carriage return||{special_chars}@ + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/encoding_xml.xml b/inst/extdata/schemas/sweCommon/examples/spec/encoding_xml.xml new file mode 100644 index 00000000..4cc798d5 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/encoding_xml.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/matrix_rotation.xml b/inst/extdata/schemas/sweCommon/examples/spec/matrix_rotation.xml new file mode 100644 index 00000000..f5d924c5 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/matrix_rotation.xml @@ -0,0 +1,26 @@ + + + + + 3 + + + + + + + 3 + + + + + + + + + + + + + 0.36,0.48,-0.8 -0.8,0.6,0 0.48,0.64,0.6 + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/nilValues.xml b/inst/extdata/schemas/sweCommon/examples/spec/nilValues.xml new file mode 100644 index 00000000..6fcdedba --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/nilValues.xml @@ -0,0 +1,44 @@ + + + + + + Radiation Dose + Radiation dose measured by Gamma detector + + + -INF + INF + + + + + + + + + Band 1 + + + 0 + 255 + + + + + + + + Band 2 + + + + + + + Band 33 + + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/quality.xml b/inst/extdata/schemas/sweCommon/examples/spec/quality.xml new file mode 100644 index 00000000..f6f39f57 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/quality.xml @@ -0,0 +1,60 @@ + + + + + + Relative Accuracy + + 5 + + + + + + Velocity + Linear velocity of the vehicle + + + Relative Accuracy + + 5 + + + + 23.5 + + + + + + Thickness + Thickness measured by the sheet metal gauge + + + Dimensional Tolerance + + -2 +0 + + + + 5.6 + + + + + + Water Pressure + Water pressure measured by CTD + + + QC Flag + + fail + + + + 1084 + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/range_components.xml b/inst/extdata/schemas/sweCommon/examples/spec/range_components.xml new file mode 100644 index 00000000..a7069677 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/range_components.xml @@ -0,0 +1,37 @@ + + + + + + Approximate Age + Approximate period expressed as a range of geological eras + + Paleozoic Mesozoic + + + + + + Index Range + 0 9999 + + + + + + Operational Range + Operational range of the cryogenic thermometer + + 10 300 + + + + + + Survey Period + + 2008-01-05T11:02:54Z 2009-11-05T16:29:26Z + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/record_coefs.xml b/inst/extdata/schemas/sweCommon/examples/spec/record_coefs.xml new file mode 100644 index 00000000..6b15dd75 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/record_coefs.xml @@ -0,0 +1,25 @@ + + + + Radial Distortion Coefficients + + + + + 1.92709e-005 + + + + + + -5.14206e-010 + + + + + + -3.33356e-012 + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/record_weather.xml b/inst/extdata/schemas/sweCommon/examples/spec/record_weather.xml new file mode 100644 index 00000000..d6e5852a --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/record_weather.xml @@ -0,0 +1,42 @@ + + + + Weather Data Record + Record of synchronous weather measurements + + + + Sampling Time + + + + + + + Air Temperature + + + + + + + Air Pressure + + + + + + + Wind Speed + + + + + + + Wind Direction + + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/simple_components.xml b/inst/extdata/schemas/sweCommon/examples/spec/simple_components.xml new file mode 100644 index 00000000..a8aa0058 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/simple_components.xml @@ -0,0 +1,130 @@ + + + + + + Motion Detected + True when motion was detected in the room + true + + + + + + Time Continuity Test + Set to true to enable time continuity test + + + + + + Manufacturer + Ocean Devices, Inc. + + + + + + Geological Period + Name of the geological period according to the nomenclature of the International Commission on Stratigraphy + + Jurassic + + + + + + Bird Species + Bird species according to the classification of the World Bird Database (WBDB) + + + + + + + Sensor Status + Current status of the sensor + + + Off + Stand-by + Ready + Busy + + + Ready + + + + + + Row Size + Number of pixels in each row of the image + 1024 + + + + + + Outside Temperature + Outside temperature taken at the top of the antenna + + 21.5 + + + + + + Radiance + Radiance measured on band1 + + 1.32e3 + + + + + + MSL Height + Height above mean sea level + + 1.32e3 + + + + + + Sampling Time + Time at which the measurement was made + + 2009-11-05T16:29:26Z + + + + + + Run Time + Run time of the model expressed as a Unix time + + 1257415633 + + + + + + Flight Time + Time at take-off in UTC + + 2009-01-26T10:21:45+01:00 + + + + + + Scanline Time + Acquisition time of the scan line + + 1256.235 + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/stream_nav.xml b/inst/extdata/schemas/sweCommon/examples/spec/stream_nav.xml new file mode 100644 index 00000000..7fd10812 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/stream_nav.xml @@ -0,0 +1,55 @@ + + + Aircraft Navigation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/vector_location.xml b/inst/extdata/schemas/sweCommon/examples/spec/vector_location.xml new file mode 100644 index 00000000..3933b0b2 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/vector_location.xml @@ -0,0 +1,17 @@ + + + + + Latitude + + 45.36 + + + + + Longitude + + 5.2 + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/vector_quaternion.xml b/inst/extdata/schemas/sweCommon/examples/spec/vector_quaternion.xml new file mode 100644 index 00000000..6db91837 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/vector_quaternion.xml @@ -0,0 +1,27 @@ + + + + + + 0.14 + + + + + + 0.22 + + + + + + 0.05 + + + + + + 0.33 + + + diff --git a/inst/extdata/schemas/sweCommon/examples/spec/vector_velocity.xml b/inst/extdata/schemas/sweCommon/examples/spec/vector_velocity.xml new file mode 100644 index 00000000..b7bb199c --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/spec/vector_velocity.xml @@ -0,0 +1,21 @@ + + + + + Velocity X + + + + + + Velocity Y + + + + + + Velocity Z + + + + diff --git a/inst/extdata/schemas/sweCommon/examples/sps/TaskingParameter_DataRecord.xml b/inst/extdata/schemas/sweCommon/examples/sps/TaskingParameter_DataRecord.xml new file mode 100644 index 00000000..a5f4778c --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/sps/TaskingParameter_DataRecord.xml @@ -0,0 +1,24 @@ + + + +Tasking Parameters description used to task a web cam + + + + Focal length of camera + + + + 18 180 + + + 65 + + + + + + false + + + diff --git a/inst/extdata/schemas/sweCommon/examples/sps/TaskingParameter_DataRecord_SPS.xml b/inst/extdata/schemas/sweCommon/examples/sps/TaskingParameter_DataRecord_SPS.xml new file mode 100644 index 00000000..a9b151c4 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/sps/TaskingParameter_DataRecord_SPS.xml @@ -0,0 +1,18 @@ + + + +Tasking Parameters description used to task a web cam + + + + Focal length of camera + + + + + + + camera pan degree + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/examples/sps/TaskingParameter_DataRecord_constraints.xml b/inst/extdata/schemas/sweCommon/examples/sps/TaskingParameter_DataRecord_constraints.xml new file mode 100644 index 00000000..5e93fc51 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/sps/TaskingParameter_DataRecord_constraints.xml @@ -0,0 +1,35 @@ + + + +Tasking Parameters description used to task a web cam + + + + Focal length of camera + + + + 18 180 + + + 65 + + + + + + Looking direction of camera + + + North East South West + + + + + + + + false + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/examples/sps/TaskingParameter_DataRecord_optional.xml b/inst/extdata/schemas/sweCommon/examples/sps/TaskingParameter_DataRecord_optional.xml new file mode 100644 index 00000000..126e643b --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/sps/TaskingParameter_DataRecord_optional.xml @@ -0,0 +1,30 @@ + + + +Tasking Parameters description used to task a web cam + + + + Focal length of camera + + + + 18 180 + + + 65 + + + + + + Minimum resolution + + + + + + false + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/examples/weather_data.xml b/inst/extdata/schemas/sweCommon/examples/weather_data.xml new file mode 100644 index 00000000..0071c07a --- /dev/null +++ b/inst/extdata/schemas/sweCommon/examples/weather_data.xml @@ -0,0 +1,80 @@ + + + + + + 10 + + + + + + + + + Sampling Time + + + + + + + Air Temperature + + + + 1 + 2 + 3 + -50 +50 + 2 + + + + + + + + Atmospheric Pressure + + + + 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + 2009-01-01T10:00:25Z,25.3,1098,5,56 + 2009-01-01T10:00:35Z,25.4,1098,15,59 + 2009-01-01T10:00:45Z,25.4,1098,12,42 + 2009-01-01T10:00:55Z,25.4,1098,5,40 + 2009-01-01T10:01:05Z,25.3,1098,5,66 + + diff --git a/inst/extdata/schemas/sweCommon/record_components.sch b/inst/extdata/schemas/sweCommon/record_components.sch new file mode 100644 index 00000000..9c6fb170 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/record_components.sch @@ -0,0 +1,40 @@ + + + + Additional validation rules for XML instances including record data components + + + Req 39 + + + Field names shall be unique within a 'DataRecord' component (Req 39) + + + + + Req 40 + + + Coordinate names shall be unique within a 'Vector' component (Req 40) + + + + + Req 41, 42, 43 + + + The 'referenceFrame' attribute is forbidden on vector coordinates (Req 41) + + + The 'axisID' attribute is mandatory on vector coordinates (Req 42) + + + The 'referenceFrame' and 'localFrame' attributes shall have different values (Req 43) + + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/record_components.xsd b/inst/extdata/schemas/sweCommon/record_components.xsd new file mode 100644 index 00000000..358c05ce --- /dev/null +++ b/inst/extdata/schemas/sweCommon/record_components.xsd @@ -0,0 +1,95 @@ + + + SWE Common Data Model schema for record data components. See requirements class http://www.opengis.net/spec/SWE/2.0/req/xsd-record-components/ + + SWE Common is an OGC Standard. + Copyright (c) 2010 Open Geospatial Consortium. + To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ . + + + + + + + + Implementation of ISO-11404 Record datatype. This allows grouping (sequence) of data components which can themselves be simple types, records, arrays or choices + + + + + + + + + Definition of the field provided as a nested data component. The field can be scalar or can itself be an aggregate such as a record, choice or array + + + + + + + + + + + + + + + + + + + + + + + + + + + Implementation of a mathematical vector composed of a list of scalar coordinates expressed in the mandatory reference frame. + + + + + + + + + Definition of the coordinate provided as a data component with a numerical representation + + + + + + + + + + + + + Frame of reference (usually spatial) with respect to which the coordinates of this vector are expressed. A reference frame anchors a vector value to a real world datum. + + + + + Frame of reference whose origin is located by the coordinates of this vector + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/simple_components.sch b/inst/extdata/schemas/sweCommon/simple_components.sch new file mode 100644 index 00000000..963ad677 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/simple_components.sch @@ -0,0 +1,74 @@ + + + + Additional validation rules for XML instances including simple data components + + + + Req 18 + + + The 'definition' attribute is mandatory on all simple data components (Req 18) + + + The 'definition' attribute is not a HTTP URL. Is is really resolvable? + + + + + Req 18 + + + The 'definition' attribute is mandatory on all range data components (Req 18) + + + The 'definition' attribute is not a HTTP URL. Is is really resolvable? + + + + + Req 25 + + + A 'Category' component must have either a code space or an enumeration constraint (Req 25) + + + + + Req 29 + + + The 'referenceFrame' and 'localFrame' attributes shall have different values (Req 29) + + + + + Req 58 + + + + A property element shall have children or an xlink:href (Req 58) + + + + + Req 65 + + + Either a UCUM code or a URI pointing to a non UCUM unit shall be specified (Req 65) + + + + + Req 66 + + + ISO8601 shall be specified as the uom when the time value is ISO8601 encoded (Req 66) + + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/simple_components.xsd b/inst/extdata/schemas/sweCommon/simple_components.xsd new file mode 100644 index 00000000..0b651e86 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/simple_components.xsd @@ -0,0 +1,536 @@ + + + SWE Common Data Model schema for simple data components (i.e. without descendants). See requirements class http://www.opengis.net/spec/SWE/2.0/req/xsd-simple-components/ + + SWE Common is an OGC Standard. + Copyright (c) 2010 Open Geospatial Consortium. + To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ . + + + + + + + + Scalar component with integer representation used for a discrete counting value + + + + + + + + + + Value is optional, to enable structure to act as a schema for values provided using other encodings + + + + + + + + + + + + + + + Pair of categorical values used to specify a range in an ordinal reference system (specified by the code space) + + + + + + + + + Name of the dictionary defining an ordered set of values with respect to which the range is expressed (ordinal reference system) + + + + + + Value is a pair of tokens separated by a space (if tokens contain spaces, they must be espaced by using XML entities). It is optional, to enable structure to act as a schema for values provided using other encodings + + + + + + + + + + + + + + + + + + + + + + + Frame of reference (usually temporal or spatial) with respect to which the value of the component is expressed. A reference frame anchors a value to a real world datum. + + + + + Specifies the reference axis (refer to gml:axisID). The reference frame URI should also be specified unless it is inherited from parent Vector + + + + + + + + + + + + + + Decimal pair for specifying a quantity range with a unit of measure + + + + + + + + + Unit of measure used to express the value of this data component + + + + + + Value is a pair of double numbers separated by a space. It is optional, to enable structure to act as a schema for values provided using other encodings + + + + + + + + + + + + + + + Scalar component used to represent a time quantity either as ISO 8601 (e.g. 2004-04-18T12:03:04.6Z) or as a duration relative to a time of reference + + + + + + + + + Temporal unit of measure used to express the value of this data component + + + + + + Value is optional, to enable structure to act as a schema for values provided using other encodings + + + + + + Specifies the origin of the temporal reference frame as an ISO8601 date (used to specify time after an epoch that is to say in a custom frame) + + + + + Temporal frame of reference whose origin is located by the value of this component + + + + + + + + + + + + + + Time value pair for specifying a time range (can be a decimal or ISO 8601) + + + + + + + + + Temporal unit of measure used to express the value of this data component + + + + + + Value is a pair of time values expressed in ISO-8601 or as decimal numbers separated by a space. It is optional, to enable structure to act as a schema for values provided using other encodings + + + + + + Specifies the origin of the temporal reference frame as an ISO8601 date (used to specify time after an epoch that is to say in a custom frame) + + + + + Temporal frame of reference whose origin is located by the value of this component + + + + + + + + + + + + + + Scalar component used to express truth: True or False, 0 or 1 + + + + + + + + + Value is optional, to enable structure to act as a schema for values provided using other encodings + + + + + + + + + + + + + + + Free text component used to store comments or any other type of textual statement + + + + + + + + + + Value is optional, to enable structure to act as a schema for values provided using other encodings + + + + + + + + + + + + + + + Scalar component used to represent a categorical value as a simple token identifying a term in a code space + + + + + + + + + Name of the dictionary where the possible values for this component are listed and defined + + + + + + Value is optional, to enable structure to act as a schema for values provided using other encodings + + + + + + + + + + + + + + + Scalar component with decimal representation and a unit of measure used to store value of a continuous quantity + + + + + + + + + Unit of measure used to express the value of this data component + + + + + + Value is optional, to enable structure to act as a schema for values provided using other encodings + + + + + + + + + + + + + + + Abstract base class for all data components + + + + + + + + Specifies if the value of a data component can be updated externally (i.e. is variable) + + + + + Specifies that data for this component can be omitted in the datastream + + + + + Reference to semantic information defining the precise nature of the component + + + + + + + + + + + + + + Integer pair used for specifying a count range + + + + + + + + + + Value is a pair of integer numbers separated by a space. It is optional, to enable structure to act as a schema for values provided using other encodings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Defines permitted values for the component, as an enumerated list of tokens or a regular expression pattern + + + + + + + + + + + + + + + + + + + + + + + + + + Defines the permitted values for the component as an enumerated list and/or a list of inclusive ranges + + + + + + + + + + + + + + + + + + + + + + + + + + + Defines the permitted values for the component, as a time range or an enumerated list of time values + + + + + + + + + + + + + + + + + + + + + + + + + + + Provides an indication of the reliability of the parent component value in the form of a decimal number (ex: relative accuracy), a range (ex: bidirectional tolerance), a categorical value (ex: good, bad) or plain textual statement + + + + + + + + + + + + + + + + + Re-usable group providing a choice of range data components + + + + + + + + + + + + + + + + + Re-usable group providing a choice of numeric data components + + + + + + + + + + + + + + + + Re-usable group providing a choice of scalar data components + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/simple_encodings.sch b/inst/extdata/schemas/sweCommon/simple_encodings.sch new file mode 100644 index 00000000..97b07137 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/simple_encodings.sch @@ -0,0 +1,30 @@ + + + + Additional validation rules for XML instances including simple encodings + + + + Req 76 + + + When text encoding is specified, values shall contain text content (Req 76) + + + When text encoding is used, the values element shall not contain sub-elements (Req 76) + + + + + Req 77 + + + When XML encoding is specified, values shall contain XML elements (Req 77) + + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/simple_encodings.xsd b/inst/extdata/schemas/sweCommon/simple_encodings.xsd new file mode 100644 index 00000000..17e6e5ba --- /dev/null +++ b/inst/extdata/schemas/sweCommon/simple_encodings.xsd @@ -0,0 +1,93 @@ + + + SWE Common Data Model schema for specifying parameters of simple encoding methods (Text, XML). See requirements class http://www.opengis.net/spec/SWE/2.0/req/xsd-simple-encodings/ + + SWE Common is an OGC Standard. + Copyright (c) 2010 Open Geospatial Consortium. + To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ . + + + + + + + + + + + + + + + + + + + + + + + + + Parameters of the XML encoding method + + + + + + + + + + + + + + + + + + + + + Parameters of the text encoding method + + + + + + + + Indicates whether white spaces (i.e. space, tab, CR, LF) should be collapsed with separators when parsing the data stream + + + + + Character used as the decimal separator + + + + + Character sequence used as the token separator (i.e. between two successive values) + + + + + Character sequence used as the block separator (i.e. between two successive blocks in the data set. The end of a block is reached once all values from the data tree have been encoded once) + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/inst/extdata/schemas/sweCommon/swe.xsd b/inst/extdata/schemas/sweCommon/swe.xsd new file mode 100644 index 00000000..67edf8f6 --- /dev/null +++ b/inst/extdata/schemas/sweCommon/swe.xsd @@ -0,0 +1,14 @@ + + + All-components schema for the SWE Common Data Model namespace. See Conformance Class urn:ogc:spec:SWECommonDataModel:2.0:XXX of the SWE Common Data Model 2.0 specification + + SWE Common is an OGC Standard. + Copyright (c) 2010 Open Geospatial Consortium. + To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ . + + + + + + + \ No newline at end of file diff --git a/man/GMLCodeType.Rd b/man/GMLCodeType.Rd new file mode 100644 index 00000000..b137e6a8 --- /dev/null +++ b/man/GMLCodeType.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/GMLCodeType.R +\docType{class} +\name{GMLCodeType} +\alias{GMLCodeType} +\title{GMLCodeType} +\format{ +\code{\link{R6Class}} object. +} +\value{ +Object of \code{\link{R6Class}} for modelling a GML code type +} +\description{ +GMLCodeType +} +\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 +} +\keyword{GML} +\keyword{codetype} diff --git a/man/SWEAbstractDataComponent.Rd b/man/SWEAbstractDataComponent.Rd new file mode 100644 index 00000000..097babb3 --- /dev/null +++ b/man/SWEAbstractDataComponent.Rd @@ -0,0 +1,71 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/SWEAbstractDataComponent.R +\docType{class} +\name{SWEAbstractDataComponent} +\alias{SWEAbstractDataComponent} +\title{SWEAbstractDataComponent} +\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} + +\item{definition}{definition} + +\item{description}{description} + +\item{name}{name} + +\item{codeSpace}{codespace} + +\item{identifier}{identifier} +} +\value{ +Object of \code{\link{R6Class}} for modelling an SWS Abstract data component +} +\description{ +Initializes an object of class \link{SWSAbstractDataComponent} + +Set definition + +Set description + +Adds name + +Deletes name + +Set identifier +} +\section{Fields}{ + +\describe{ +\item{\code{definition}}{definition} + +\item{\code{description}}{description} + +\item{\code{label}}{label} + +\item{\code{name}}{name} + +\item{\code{identifier}}{identifier} +}} + +\note{ +Class used internally by geometa +} +\references{ +OGC Geography Markup Language. https://www.ogc.org/standards/swecommon +} +\author{ +Emmanuel Blondel +} +\keyword{ISO} +\keyword{SWE} diff --git a/man/SWEAbstractObject.Rd b/man/SWEAbstractObject.Rd new file mode 100644 index 00000000..f4c47248 --- /dev/null +++ b/man/SWEAbstractObject.Rd @@ -0,0 +1,34 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/SWEAbstractObject.R +\docType{class} +\name{SWEAbstractObject} +\alias{SWEAbstractObject} +\title{SWEAbstractObject} +\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 GML abstract object +} +\description{ +Initializes an object of class \link{SWEAbstractObject} +} +\note{ +Class used internally by geometa +} +\author{ +Emmanuel Blondel +} +\keyword{GML} +\keyword{ISO} diff --git a/tests/testthat/test_GMLCodeType.R b/tests/testthat/test_GMLCodeType.R new file mode 100644 index 00000000..899b4f25 --- /dev/null +++ b/tests/testthat/test_GMLCodeType.R @@ -0,0 +1,26 @@ +# test_GMLCodeType.R +# Author: Emmanuel Blondel +# +# Description: Unit tests for GMLCodeType.R +#======================= +require(geometa, quietly = TRUE) +require(testthat) +require(XML) + +context("GMLCodeType") + +test_that("encoding",{ + testthat::skip_on_cran() + + #encoding + gml <- GMLCodeType$new(value = "value", codeSpace = "codespace") + xml <- gml$encode() + expect_is(xml, "XMLInternalNode") + + #decoding + gml2 <- GMLCodeType$new(xml = xml) + xml2 <- gml2$encode() + + expect_true(ISOAbstractObject$compare(gml, gml2)) + +}) \ No newline at end of file diff --git a/tests/testthat/test_SWEAbstractDataComponent.R b/tests/testthat/test_SWEAbstractDataComponent.R new file mode 100644 index 00000000..13d0046b --- /dev/null +++ b/tests/testthat/test_SWEAbstractDataComponent.R @@ -0,0 +1,27 @@ +# test_SWEAbstractDataComponent.R +# Author: Emmanuel Blondel +# +# Description: Unit tests for classes inheriting SWEAbstractDataComponent.R +#======================= +require(geometa, quietly = TRUE) +require(sf) +require(testthat) + +context("SWEAbstractDataComponent") + +test_that("SWEAbstractDataComponent",{ + testthat::skip_on_cran() + #encoding + adc <- SWEAbstractDataComponent$new() + adc$addName("test name") + adc$setDefinition("definition") + adc$setDescription("description") + adc$setIdentifier("identifier") + xml <- adc$encode() + expect_is(xml, "XMLInternalNode") + #decoding + adc2 <- SWEAbstractDataComponent$new(xml = xml) + xml2 <- adc2$encode() + #assert object identity + expect_true(ISOAbstractObject$compare(adc, adc2)) +})