Skip to content

Commit

Permalink
#181 support M5 - MCO & FCC classes
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Oct 6, 2024
1 parent d452fd4 commit 61c8271
Show file tree
Hide file tree
Showing 19 changed files with 1,058 additions and 61 deletions.
5 changes: 5 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export(ISOAbstractContentInformation)
export(ISOAbstractDataQuality)
export(ISOAbstractDistribution)
export(ISOAbstractExtent)
export(ISOAbstractFeatureType)
export(ISOAbstractFormat)
export(ISOAbstractGenericName)
export(ISOAbstractLineageInformation)
Expand Down Expand Up @@ -136,6 +137,7 @@ export(ISOAssociatedResource)
export(ISOAssociation)
export(ISOAssociationRole)
export(ISOAssociationType)
export(ISOAttributeGroup)
export(ISOAttributes)
export(ISOBand)
export(ISOBaseBoolean)
Expand Down Expand Up @@ -205,6 +207,7 @@ export(ISOFeatureCatalogue)
export(ISOFeatureCatalogueDescription)
export(ISOFeatureOperation)
export(ISOFeatureType)
export(ISOFeatureTypeInfo)
export(ISOFileName)
export(ISOFormat)
export(ISOFormatConsistency)
Expand Down Expand Up @@ -278,6 +281,7 @@ export(ISOLocalName)
export(ISOLocale)
export(ISOLocaleContainer)
export(ISOLocalisedCharacterString)
export(ISOMDFeatureCatalogue)
export(ISOMLCodeDefinition)
export(ISOMLCodeListDictionary)
export(ISOMaintenanceFrequency)
Expand Down Expand Up @@ -365,6 +369,7 @@ export(ISOUomIdentifier)
export(ISOUsage)
export(ISOVectorSpatialRepresentation)
export(ISOVerticalExtent)
export(ISoAbstractFeatureCatalogue)
export(SWEAbstractDataComponent)
export(SWEAbstractEncoding)
export(SWEAbstractObject)
Expand Down
13 changes: 10 additions & 3 deletions R/ISOAbstractCatalogue.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' ISO 19139:2007 Metadata - XML schema implementation
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/cat/1.2.0/cat/#element_AbstractCT_Catalogue}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/cat/1.0/cat/#element_AbstractCT_Catalogue}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand All @@ -17,7 +19,10 @@ ISOAbstractCatalogue <- R6Class("ISOAbstractCatalogue",
private = list(
document = TRUE,
xmlElement = "AbstractCT_Catalogue",
xmlNamespacePrefix = "GMX"
xmlNamespacePrefix = list(
"19139" = "GMX",
"19115-3" = "CAT"
)
),
public = list(

Expand All @@ -37,7 +42,7 @@ ISOAbstractCatalogue <- R6Class("ISOAbstractCatalogue",
characterSet = NULL,
#'@field locale locale [0..*]: ISOLocale
locale = list(),
#'@field subCatalogue subCatalogue [0..*]: ISOAbstractCatalogue
#'@field subCatalogue subCatalogue [0..*]: ISOAbstractCatalogue (=> 19139)
subCatalogue = list(),

#'@description Initializes object
Expand Down Expand Up @@ -158,6 +163,7 @@ ISOAbstractCatalogue <- R6Class("ISOAbstractCatalogue",
#'@param subCatalogue object of class \link{ISOAbstractCatalogue}
#'@return \code{TRUE} if added, \code{FALSE} otherwise
addSubCatalogue = function(subCatalogue){
self$stopIfMetadataStandardIsNot("19139")
if(!is(subCatalogue, "ISOAbstractCatalogue")){
stop("The argument should be an object inheriting 'ISOAbstractCatalogue")
}
Expand All @@ -168,6 +174,7 @@ ISOAbstractCatalogue <- R6Class("ISOAbstractCatalogue",
#'@param subCatalogue object of class \link{ISOAbstractCatalogue}
#'@return \code{TRUE} if deleted, \code{FALSE} otherwise
delSubCatalogue = function(subCatalogue){
self$stopIfMetadataStandardIsNot("19139")
if(!is(subCatalogue, "ISOAbstractCatalogue")){
stop("The argument should be an object inheriting 'ISOAbstractCatalogue")
}
Expand Down
31 changes: 31 additions & 0 deletions R/ISOAbstractFeatureCatalogue.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#' ISoAbstractFeatureCatalogue
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO feature catalogue
#' @return Object of \code{\link{R6Class}} for modelling a ISO abstract feature catalogue
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19110/-/fcc/2.2/fcc/#element_Abstract_FeatureCatalogue}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISoAbstractFeatureCatalogue <- R6Class("ISoAbstractFeatureCatalogue",
inherit = ISOAbstractCatalogue,
private = list(
xmlElement = "Abstract_FeatureCatalogue",
xmlNamespacePrefix = list(
"19115-3" = "FCC"
)
),
public = list(

#'@description Initializes object
#'@param xml object of class \link{XMLInternalNode-class}
initialize = function(xml = NULL){
super$initialize(xml = xml)
}
)
)
31 changes: 31 additions & 0 deletions R/ISOAbstractFeatureType.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#' ISOAbstractFeatureType
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO feature type
#' @return Object of \code{\link{R6Class}} for modelling a ISO abstract feature type
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19110/-/fcc/2.2/fcc/#element_Abstract_FeatureType}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOAbstractFeatureType <- R6Class("ISOAbstractFeatureType",
inherit = ISOAbstractObject,
private = list(
xmlElement = "Abstract_FeatureType",
xmlNamespacePrefix = list(
"19115-3" = "FCC"
)
),
public = list(

#'@description Initializes object
#'@param xml object of class \link{XMLInternalNode-class}
initialize = function(xml = NULL){
super$initialize(xml = xml)
}
)
)
86 changes: 86 additions & 0 deletions R/ISOAttributeGroup.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#' ISOAttributeGroup
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO attribute group
#' @return Object of \code{\link{R6Class}} for modelling a ISO attribute group
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MD_AttributeGroup}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOAttributeGroup <- R6Class("ISOAttributeGroup",
inherit = ISOAbstractObject,
private = list(
xmlElement = "MD_AttributeGroup",
xmlNamespacePrefix = list(
"19115-3" = "MRC"
)
),
public = list(

#'@field contentType contentType [1..*] : ISOCoverageContentType
contentType = list(),
#'@field attribute attribute [0..*] : ISORangeDimension
attribute = list(),

#'@description Initializes object
#'@param xml object of class \link{XMLInternalNode-class}
initialize = function(xml = NULL){
super$initialize(xml = xml)
},

#'@description Adds coverage content type
#'@param contentType contentType object of class \link{ISOCoverageContentType} or any value among
#'values listed in \code{ISOCoverageContentType$values()}
#'@return \code{TRUE} if added, \code{FALSe} otherwise
addContentType = function(contentType){
if(!is(contentType, "ISOCoverageContentType")){
if(is(contentType, "character")){
contentType = ISOCoverageContentType$new(value = contentType)
}else{
stop("The argument should be an object of class 'ISOCoverageContentType' or 'character'")
}
}
return(self$addListElement("contentType", contentType))
},

#'@description Deletes coverage content type
#'@param contentType contentType object of class \link{ISOCoverageContentType} or any value among
#'values listed in \code{ISOCoverageContentType$values()}
#'@return \code{TRUE} if deleted, \code{FALSe} otherwise
delContentType = function(contentType){
if(!is(contentType, "ISOCoverageContentType")){
if(is(contentType, "character")){
contentType = ISOCoverageContentType$new(value = contentType)
}else{
stop("The argument should be an object of class 'ISOCoverageContentType' or 'character'")
}
}
return(self$delListElement("contentType", contentType))
},

#'@description Adds attribute
#'@param attribute object of class \link{ISORangeDimension}
#'@return \code{TRUE} if added, \code{FALSe} otherwise
addAttribute = function(attribute){
if(!is(attribute, "ISORangeDimension")){
stop("The argument should be an object of class 'ISORangeDimension'")
}
return(self$addListElement("attribute", attribute))
},

#'@description Deletes attribute
#'@param attribute object of class \link{ISORangeDimension}
#'@return \code{TRUE} if deleted, \code{FALSe} otherwise
delAttribute = function(attribute){
if(!is(attribute, "ISORangeDimension")){
stop("The argument should be an object of class 'ISORangeDimension'")
}
return(self$delListElement("attribute", attribute))
}
)
)
16 changes: 4 additions & 12 deletions R/ISOCodelistCatalogue.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' ISO/TS 19139:2007 Geographic information -- XML
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/cat/1.2.0/cat/#element_CT_CodelistCatalogue}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/cat/1.0/cat/#element_CT_CodelistCatalogue}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOCodelistCatalogue <- R6Class("ISOCodelistCatalogue",
inherit = ISOAbstractObject,
inherit = ISOAbstractCatalogue,
private = list(
xmlElement = "CT_CodelistCatalogue",
xmlNamespacePrefix = list(
Expand All @@ -22,16 +24,6 @@ ISOCodelistCatalogue <- R6Class("ISOCodelistCatalogue",
)
),
public = list(
#'@field name name
name = NULL,
#'@field scope scope
scope = NULL,
#'@field fieldOfApplication field of application
fieldOfApplication = NULL,
#'@field versionNumber version number
versionNumber = NULL,
#'@field versionDate version date
versionDate = NULL,
#'@field codelistItem codelist items
codelistItem = list(),

Expand Down
51 changes: 51 additions & 0 deletions R/ISOFeatureTypeInfo.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#' ISOFeatureTypeInfo
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO feature type info
#' @return Object of \code{\link{R6Class}} for modelling a ISO feature type info
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MD_FeatureTypeInfo}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOFeatureTypeInfo <- R6Class("ISOFeatureTypeInfo",
inherit = ISOAbstractObject,
private = list(
xmlElement = "MD_FeatureTypeInfo",
xmlNamespacePrefix = list(
"19115-3" = "MRC"
)
),
public = list(

#'@field featureTypeName featureTypeName [1..1] : ISOFeatureTypeInfo
featureTypeName = NULL,
#'@field featureInstanceCount featureInstanceCount [0..1]: Integer
featureInstanceCount = NULL,

#'@description Initializes object
#'@param xml object of class \link{XMLInternalNode-class}
initialize = function(xml = NULL){
super$initialize(xml = xml)
},

#'@description Set feature type Name
#'@param name object of class \link{ISOGenericName} or \link{character}
setFeatureTypeName = function(name){
if(!is(name, "ISOAbstractGenericName")){
name = ISOAbstractGenericName$new(value = name)
}
self$featureTypeName = name
},

#'@description Set feature instance count
#'@param count object of class \link{integer}
setFeatureInstanceCount = function(count){
self$featureInstanceCount = as.integer(count)
}
)
)
54 changes: 54 additions & 0 deletions R/ISOMDFeatureCatalogue.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#' ISOMDFeatureCatalogue
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO feature catalogue
#' @return Object of \code{\link{R6Class}} for modelling a ISO feature catalogue
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MD_FeatureCatalogue}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOMDFeatureCatalogue <- R6Class("ISOMDFeatureCatalogue",
inherit = ISOAbstractContentInformation,
private = list(
xmlElement = "MD_FeatureCatalogue",
xmlNamespacePrefix = list(
"19115-3" = "MRC"
)
),
public = list(

#'@field featureCatalogue featureCatalogue [1..*] : ISOAbstractFeatureCatalogue
featureCatalogue = list(),

#'@description Initializes object
#'@param xml object of class \link{XMLInternalNode-class}
initialize = function(xml = NULL){
super$initialize(xml = xml)
},

#'@description Adds feature catalogue
#'@param featureCatalogue object inheriting class \link{ISOAbstractFeatureCatalogue}
#'@return \code{TRUE} if added, \code{FALSe} otherwise
addFeatureCatalogue = function(featureCatalogue){
if(!is(featureCatalogue, "ISOAbstractFeatureCatalogue")){
stop("The argument should be an object of class 'ISOAbstractFeatureCatalogue'")
}
return(self$addListElement("featureCatalogue", featureCatalogue))
},

#'@description Adds feature catalogue
#'@param featureCatalogue object inheriting class \link{ISOAbstractFeatureCatalogue}
#'@return \code{TRUE} if deleted, \code{FALSe} otherwise
delFeatureCatalogue = function(featureCatalogue){
if(!is(featureCatalogue, "ISOAbstractFeatureCatalogue")){
stop("The argument should be an object of class 'ISOAbstractFeatureCatalogue'")
}
return(self$delListElement("featureCatalogue", featureCatalogue))
}
)
)
Loading

0 comments on commit 61c8271

Please sign in to comment.