Skip to content

Commit

Permalink
#187 1st support of SWE - testing
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed May 5, 2022
1 parent 84a07c2 commit 14d753b
Show file tree
Hide file tree
Showing 70 changed files with 3,642 additions and 9 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]", comment = c(ORCID = "0000-0002-5870-5762")))
Maintainer: Emmanuel Blondel <[email protected]>
Description: Provides facilities to handle reading and writing of geographic metadata
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export(GMLBaseUnit)
export(GMLCOVAbstractCoverage)
export(GMLCOVExtension)
export(GMLCartesianCS)
export(GMLCodeType)
export(GMLCompoundCRS)
export(GMLConventionalUnit)
export(GMLConversion)
Expand Down Expand Up @@ -318,6 +319,8 @@ export(ISOUnlimitedInteger)
export(ISOUsage)
export(ISOVectorSpatialRepresentation)
export(ISOVerticalExtent)
export(SWEAbstractDataComponent)
export(SWEAbstractObject)
export(cacheISOClasses)
export(convert_metadata)
export(geometaLogger)
Expand Down
35 changes: 35 additions & 0 deletions R/GMLCodeType.R
Original file line number Diff line number Diff line change
@@ -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 <emmanuel.blondel1@@gmail.com>
#'
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
}
}
)
)
2 changes: 1 addition & 1 deletion R/ISOAbstractGenericName.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOAbstractGenericName <- R6Class("ISOAbstractGenericName",
inherit = ISOAbstractObject,
inherit = GMLCodeType,
private = list(
xmlElement = "AbstractGenericName",
xmlNamespacePrefix = "GCO"
Expand Down
3 changes: 2 additions & 1 deletion R/ISOAbstractObject.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 3 additions & 1 deletion R/ISOMetadataNamespace.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -60,8 +61,9 @@ setISOMetadataNamespaces <- function(){
ISOMetadataNamespace$GML,
ISOMetadataNamespace$GMLCOV,
ISOMetadataNamespace$GMLRGRID,
ISOMetadataNamespace$SWE,
ISOMetadataNamespace$XLINK,
ISOMetadataNamespace$XSI
ISOMetadataNamespace$XSI
)
}

Expand Down
80 changes: 80 additions & 0 deletions R/SWEAbstractDataComponent.R
Original file line number Diff line number Diff line change
@@ -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 <emmanuel.blondel1@@gmail.com>
#'
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
}
)
)
35 changes: 35 additions & 0 deletions R/SWEAbstractObject.R
Original file line number Diff line number Diff line change
@@ -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 <emmanuel.blondel1@@gmail.com>
#'
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)
}
)
)
3 changes: 2 additions & 1 deletion R/geometa_coverage.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion inst/extdata/coverage/coverage.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
33 changes: 33 additions & 0 deletions inst/extdata/coverage/geometa_coverage_inventory.csv
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,13 @@
"ISO/TC211 19139:2007","Geographic Metadata XML Schema","GMX","OperationParameterAlt","<missing>",FALSE
"ISO/TC211 19139:2007","Geographic Metadata XML Schema","GMX","PrimeMeridianAlt","<missing>",FALSE
"ISO/TC211 19139:2007","Geographic Metadata XML Schema","GMX","UomAlternativeExpression","<missing>",FALSE
"ISO/TC211 19139:2007","Geographic Metadata XML Schema - Geographic Temporal Schema (GTS)","GTS","TM_PeriodDuration","<missing>",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
Expand Down Expand Up @@ -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","<missing>",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","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractSWE","<missing>",FALSE
"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","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
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","BinaryEncoding","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Block","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Category","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","CategoryRange","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Component","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Count","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","CountRange","<missing>",FALSE
"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","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
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Quantity","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","QuantityRange","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Text","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","TextEncoding","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Time","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","TimeRange","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","Vector","<missing>",FALSE
"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","XMLEncoding","<missing>",FALSE
5 changes: 3 additions & 2 deletions inst/extdata/coverage/geometa_coverage_summary.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions inst/extdata/schemas/gmd/gmd.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<xs:import namespace="http://www.isotc211.org/2005/gfc" schemaLocation="../gfc/gfc.xsd"/>
<!-- 20180910 @eblondel add GML 3.3. referenceableGrid.xsd inc for validation -->
<xs:import namespace="http://www.opengis.net/gml/3.3/rgrid" schemaLocation="../gmlrgrid/referenceableGrid.xsd"/>
<!-- 20220217 @eblondel add SWE schemas for validation -->
<xs:import namespace="http://www.opengis.net/swe/2.0" schemaLocation="../sweCommon/swe.xsd"/>
<!-- ########################################################################### -->
<!-- ########################################################################### -->
<!-- ================================== Classes ================================= -->
Expand Down
62 changes: 62 additions & 0 deletions inst/extdata/schemas/sweCommon/ReadMe.txt
Original file line number Diff line number Diff line change
@@ -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 <include/> 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.

-----------------------------------------------------------------------
Loading

0 comments on commit 14d753b

Please sign in to comment.