Skip to content

Commit

Permalink
#181 M4 support MRC schema - content information + M5 new class MD_Sa…
Browse files Browse the repository at this point in the history
…mpleDimension
  • Loading branch information
eblondel committed Oct 2, 2024
1 parent 75450c0 commit 510e906
Show file tree
Hide file tree
Showing 40 changed files with 829 additions and 129 deletions.
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export(ISOAbstractAggregate)
export(ISOAbstractCarrierOfCharacteristics)
export(ISOAbstractCatalogue)
export(ISOAbstractCompleteness)
export(ISOAbstractContentInformation)
export(ISOAbstractGenericName)
export(ISOAbstractLogicalConsistency)
export(ISOAbstractObject)
Expand Down Expand Up @@ -143,7 +144,6 @@ export(ISOConformanceResult)
export(ISOConstraint)
export(ISOConstraints)
export(ISOContact)
export(ISOContentInformation)
export(ISOCountry)
export(ISOCoupledResource)
export(ISOCouplingType)
Expand Down Expand Up @@ -301,6 +301,7 @@ export(ISORestriction)
export(ISORole)
export(ISORoleType)
export(ISOSRVServiceIdentification)
export(ISOSampleDimension)
export(ISOScale)
export(ISOScope)
export(ISOScopeDescription)
Expand Down
10 changes: 9 additions & 1 deletion R/ISOBand.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,20 @@
#' xml <- md$encode()
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
#' @references
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_Band}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MD_Band}
#'
ISOBand <- R6Class("ISOBand",
inherit = ISORangeDimension,
private = list(
xmlElement = "MD_Band",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MRC"
)
),
public = list(

Expand Down
17 changes: 11 additions & 6 deletions R/ISOContentInformation.R
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
#' ISOContentInformation
#' ISOAbstractContentInformation
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO content information
#' @return Object of \code{\link{R6Class}} for modelling an ISOContentInformation
#' @keywords ISO abstract content information
#' @return Object of \code{\link{R6Class}} for modelling an ISOAbstractContentInformation
#' @format \code{\link{R6Class}} object.
#'
#' @note Abstract class. Used internally by \pkg{geometa}
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_AbstractMD_ContentInformation}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_AbstractMD_ContentInformation}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOContentInformation <- R6Class("ISOContentInformation",
ISOAbstractContentInformation <- R6Class("ISOAbstractContentInformation",
inherit = ISOAbstractObject,
private = list(
xmlElement = "AbstractMD_ContentInformation",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MRC"
)
),
public = list(

Expand Down
13 changes: 9 additions & 4 deletions R/ISOCoverageContentType.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,22 @@
#'
#' #example of CoverageContentType
#' modelResultType <- ISOCoverageContentType$new(value = "modelResult")
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_CoverageContentTypeCode}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MD_CoverageContentTypeCode}
#'
ISOCoverageContentType <- R6Class("ISOCoverageContentType",
inherit = ISOCodeListValue,
private = list(
xmlElement = "MD_CoverageContentTypeCode",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MRC"
)
),
public = list(

Expand Down
11 changes: 8 additions & 3 deletions R/ISOCoverageDescription.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,20 @@
#' xml <- md$encode()
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_CoverageDescription}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MD_CoverageDescription}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOCoverageDescription <- R6Class("ISOCoverageDescription",
inherit = ISOContentInformation,
inherit = ISOAbstractContentInformation,
private = list(
xmlElement = "MD_CoverageDescription",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MRC"
)
),
public = list(

Expand Down
11 changes: 8 additions & 3 deletions R/ISOFeatureCatalogueDescription.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,20 @@
#' md$addFeatureCatalogueCitation(cit)
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_FeatureCatalogueDescription}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MD_FeatureCatalogueDescription}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOFeatureCatalogueDescription <- R6Class("ISOFeatureCatalogueDescription",
inherit = ISOContentInformation,
inherit = ISOAbstractContentInformation,
private = list(
xmlElement = "MD_FeatureCatalogueDescription",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MRC"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISOImageDescription.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,20 @@
#' xml <- md$encode()
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_ImageDescription}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MD_ImageDescription}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageDescription <- R6Class("ISOImageDescription",
inherit = ISOCoverageDescription,
private = list(
xmlElement = "MD_ImageDescription",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MRC"
)
),
public = list(
#'@field illuminationElevationAngle illuminationElevationAngle [0..1]
Expand Down
11 changes: 10 additions & 1 deletion R/ISOImageryBand.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,21 @@
#' xml <- md$encode()
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
#' @references
#' - ISO 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_Band}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MI_Band}
#'
#'
ISOImageryBand <- R6Class("ISOImageryBand",
inherit = ISOBand,
private = list(
xmlElement = "MI_Band",
xmlNamespacePrefix = "GMI"
xmlNamespacePrefix = list(
"19139" = "GMI",
"19115-3" = "MRC"
)
),
public = list(
#'@field bandBoundaryDefinition bandBoundaryDefinition [0..1]: ISOImageryBandDefinition
Expand Down
9 changes: 7 additions & 2 deletions R/ISOImageryBandDefinition.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@
#' fiftyp <- ISOImageryBandDefinition$new(value = "fiftyPercent")
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#' - ISO 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_BandDefinition}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MI_BandDefinition}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryBandDefinition <- R6Class("ISOImageryBandDefinition",
inherit = ISOCodeListValue,
private = list(
xmlElement = "MI_BandDefinition",
xmlNamespacePrefix = "GMI"
xmlNamespacePrefix = list(
"19139" = "GMI",
"19115-3" = "MRC"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISOImageryCoverageDescription.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,20 @@
#' xml <- md$encode()
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_CoverageDescription}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MI_CoverageDescription}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryCoverageDescription <- R6Class("ISOImageryCoverageDescription",
inherit = ISOCoverageDescription,
private = list(
xmlElement = "MI_CoverageDescription",
xmlNamespacePrefix = "GMI"
xmlNamespacePrefix = list(
"19139" = "GMI",
"19115-3" = "MRC"
)
),
public = list(
#'@field rangeElementDescription rangeElementDescription [0..*] : ISOImageryRangeElementDescription
Expand Down
9 changes: 7 additions & 2 deletions R/ISOImageryImageDescription.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,20 @@
#' xml <- md$encode()
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#' - ISO 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_ImageDescription}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MI_ImageDescription}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryImageDescription <- R6Class("ISOImageryImageDescription",
inherit = ISOImageDescription,
private = list(
xmlElement = "MI_ImageDescription",
xmlNamespacePrefix = "GMI"
xmlNamespacePrefix = list(
"19139" = "GMI",
"19115-3" = "MRC"
)
),
public = list(
#'@field rangeElementDescription rangeElementDescription [0..*] : ISOImageryRangeElementDescription
Expand Down
9 changes: 7 additions & 2 deletions R/ISOImageryPolarisationOrientation.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@
#' h <- ISOImageryPolarisationOrientation$new(value = "horizontal")
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#' - ISO 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_PolarisationOrientationCode}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MI_PolarisationOrientationCode}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryPolarisationOrientation <- R6Class("ISOImageryPolarisationOrientation",
inherit = ISOCodeListValue,
private = list(
xmlElement = "MI_PolarisationOrientationCode",
xmlNamespacePrefix = "GMI"
xmlNamespacePrefix = list(
"19139" = "GMI",
"19115-3" = "MRC"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISOImageryRangeElementDescription.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,20 @@
#' xml <- md$encode()
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#' - ISO 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_RangeElementDescription}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MI_RangeElementDescription}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryRangeElementDescription <- R6Class("ISOImageryRangeElementDescription",
inherit = ISOAbstractObject,
private = list(
xmlElement = "MI_RangeElementDescription",
xmlNamespacePrefix = "GMI"
xmlNamespacePrefix = list(
"19139" = "GMI",
"19115-3" = "MRC"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISOImageryTransferFunctionType.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@
#' log <- ISOImageryTransferFunctionType$new(value = "logarithmic")
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#' - ISO 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_TransferFunctionTypeCode}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MI_TransferFunctionTypeCode}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryTransferFunctionType <- R6Class("ISOImageryTransferFunctionType",
inherit = ISOCodeListValue,
private = list(
xmlElement = "MI_TransferFunctionTypeCode",
xmlNamespacePrefix = "GMI"
xmlNamespacePrefix = list(
"19139" = "GMI",
"19115-3" = "MRC"
)
),
public = list(

Expand Down
9 changes: 7 additions & 2 deletions R/ISOImagingCondition.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@
#' ImagingCondition <- ISOImagingCondition$new(value = "rain")
#'
#' @references
#' ISO 19115:2003 - Geographic information -- Metadata
#' - ISO 19139 \url{https://schemas.isotc211.org/19139/-/gmd/1.0/gmd/#element_MD_ImagingConditionCode}
#'
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mrc/1.0/mrc/#element_MD_ImagingConditionCode}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImagingCondition <- R6Class("ISOImagingCondition",
inherit = ISOCodeListValue,
private = list(
xmlElement = "MD_ImagingConditionCode",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139" = "GMD",
"19115-3" = "MRC"
)
),
public = list(

Expand Down
12 changes: 6 additions & 6 deletions R/ISOMetadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -734,21 +734,21 @@ ISOMetadata <- R6Class("ISOMetadata",
#--------------------------------------------------------------------------

#'@description Adds content information
#'@param contentInfo object of class inheriting \link{ISOContentInformation}
#'@param contentInfo object of class inheriting \link{ISOAbstractContentInformation}
#'@return \code{TRUE} if added, \code{FALSE} otherwise
addContentInfo = function(contentInfo){
if(!is(contentInfo,"ISOContentInformation")){
stop("The argument should be a 'ISOContentInformation' object")
if(!is(contentInfo,"ISOAbstractContentInformation")){
stop("The argument should be a 'ISOAbstractContentInformation' object")
}
return(self$addListElement("contentInfo", contentInfo))
},

#'@description Deletes content information
#'@param contentInfo object of class inheriting \link{ISOContentInformation}
#'@param contentInfo object of class inheriting \link{ISOAbstractContentInformation}
#'@return \code{TRUE} if deleted, \code{FALSE} otherwise
delContentInfo = function(contentInfo){
if(!is(contentInfo,"ISOContentInformation")){
stop("The argument should be a 'ISOContentInformation' object")
if(!is(contentInfo,"ISOAbstractContentInformation")){
stop("The argument should be a 'ISOAbstractContentInformation' object")
}
return(self$delListElement("contentInfo", contentInfo))
}
Expand Down
Loading

0 comments on commit 510e906

Please sign in to comment.