Skip to content

Commit

Permalink
#181 support M4/M5 for MAC classes + fix schema for inclusion of MI_M…
Browse files Browse the repository at this point in the history
…etadata
  • Loading branch information
eblondel committed Oct 6, 2024
1 parent 748a005 commit 728a0ec
Show file tree
Hide file tree
Showing 37 changed files with 746 additions and 44 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ export(ISOIndividual)
export(ISOInheritanceRelation)
export(ISOInitiative)
export(ISOInitiativeType)
export(ISOInstrumentationEventType)
export(ISOKeywordClass)
export(ISOKeywordType)
export(ISOKeywords)
Expand Down
14 changes: 12 additions & 2 deletions R/ISOImageryAcquisitionInformation.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_AcquisitionInformation}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/1.0/mac/#element_MI_AcquisitionInformation}
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_AcquisitionInformation}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand All @@ -31,7 +31,8 @@ ISOImageryAcquisitionInformation <- R6Class("ISOImageryAcquisitionInformation",
)
),
public = list(

#'@field scope scope [0..1]: ISOScope
scope = NULL,
#'@field instrument instrument [0..*]: ISOImageryInstrument
instrument = list(),
#'@field operation operation [0..*]: ISOImageryOperation
Expand All @@ -53,6 +54,15 @@ ISOImageryAcquisitionInformation <- R6Class("ISOImageryAcquisitionInformation",
super$initialize(xml = xml)
},

#'@description Set scope
#'@param scope object of class \link{ISOScope}
setScope = function(scope){
if(!is(scope, "ISOScope")){
stop("The argument should be an object of class 'ISOScope'")
}
self$scope = scope
},

#'@description Adds instrument
#'@param instrument object of class \link{ISOImageryInstrument}
#'@return \code{TRUE} if added, \code{FALSE} otherwise
Expand Down
2 changes: 1 addition & 1 deletion R/ISOImageryContext.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_ContextCode}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/1.0/mac/#element_MI_ContextCode}
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_ContextCode}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand Down
32 changes: 31 additions & 1 deletion R/ISOImageryEnvironmentalRecord.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_EnvironmentalRecord}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/1.0/mac/#element_MI_EnvironmentalRecord}
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_EnvironmentalRecord}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand All @@ -42,6 +42,10 @@ ISOImageryEnvironmentalRecord <- R6Class("ISOImageryEnvironmentalRecord",
maxAltitude = NULL,
#'@field meterologicalConditions meterologicalConditions
meterologicalConditions = NULL,
#'@field solarAzimuth solarAzimuth
solarAzimuth = NULL,
#'@field solarElevation solarElevation
solarElevation = NULL,

#'@description Initializes object
#'@param xml object of class \link{XMLInternalNode-class}
Expand Down Expand Up @@ -96,6 +100,32 @@ ISOImageryEnvironmentalRecord <- R6Class("ISOImageryEnvironmentalRecord",
conditions <- self$createLocalisedProperty(conditions, locales)
}
self$meterologicalConditions <- conditions
},

#'@description Set solar azimuth
#'@param solarAzimuth object of class \link{numeric}
setSolarAzimuth = function(solarAzimuth){
sa <- solarAzimuth
if(!is(sa, "numeric")){
sa <- as.numeric(sa)
if(is.na(sa)){
stop("The argument should be an object of class or coerceable to 'numeric'")
}
}
self$solarAzimuth <- sa
},

#'@description Set solar elevation
#'@param solarElevation object of class \link{numeric}
setSolarElevation = function(solarElevation){
se <- solarElevation
if(!is(se, "numeric")){
se <- as.numeric(se)
if(is.na(se)){
stop("The argument should be an object of class or coerceable to 'numeric'")
}
}
self$solarElevation <- se
}

)
Expand Down
2 changes: 1 addition & 1 deletion R/ISOImageryEvent.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_Event}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/1.0/mac/#element_MI_Event}
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_Event}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand Down
2 changes: 1 addition & 1 deletion R/ISOImageryGeometryType.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_GeometryTypeCode}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/1.0/mac/#element_MI_GeometryTypeCode}
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_GeometryTypeCode}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand Down
68 changes: 67 additions & 1 deletion R/ISOImageryInstrument.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_Instrument}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/1.0/mac/#element_MI_Instrument}
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_Instrument}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand All @@ -42,6 +42,14 @@ ISOImageryInstrument <- R6Class("ISOImageryInstrument",
description = NULL,
#'@field mountedOn mountedOn [0..*]: ISOImageryPlatform
mountedOn = list(),
#'@field otherPropertyType otherPropertyType [0..1] : ISORecordType (=> ISO 19115-3)
otherPropertyType = NULL,
#'@field otherProperty otherProperty [0..1] : ISORecord (=> ISO 19115-3)
otherProperty = NULL,
#'@field sensor sensor [0..*] : ISOImagerySensor (=> ISO 19115-3)
sensor = list(),
#'@field history history [0..*] : ISOInstrumentationEventList (=> ISO 19115-3)
history = list(),

#'@description Initializes object
#'@param xml object of class \link{XMLInternalNode-class}
Expand Down Expand Up @@ -120,6 +128,64 @@ ISOImageryInstrument <- R6Class("ISOImageryInstrument",
stop("The argument should be an object of class 'ISOImageryPlatform'")
}
return(self$delListElement("mountedOn", platform))
},

#'@description setOtherPropertyType
#'@param otherPropertyType otherPropertyType object of class \link{ISORecordType}
setOtherPropertyType = function(otherPropertyType){
if(!is(otherPropertyType, "ISORecordType")){
otherPropertyType = ISORecordType$new(value = otherPropertyType)
}
self$otherPropertyType = otherPropertyType
},

#'@description setOtherProperty
#'@param otherProperty otherProperty object of class \link{ISORecord}
setOtherProperty = function(otherProperty){
if(!is(otherProperty, "ISORecord")){
otherProperty = ISORecord$new(value = otherProperty)
}
self$otherProperty = otherProperty
},

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

#'@description Deletes sensor
#'@param sensor object of class \link{ISOImagerySensor}
#'@return \code{TRUE} if deleted, \code{FALSE} otherwise
delSensor = function(sensor){
if(!is(sensor, "ISOImagerySensor")){
stop("The argument should be an object of class 'ISOImagerySensor'")
}
return(self$delListElement("sensor", sensor))
},

#'@description Adds instrumentation event list
#'@param instrumentEventList object of class \link{ISOInstrumentationEventList}
#'@return \code{TRUE} if added, \code{FALSE} otherwise
addInstrumentationEventList = function(instrumentEventList){
if(!is(instrumentEventList, "ISOInstrumentationEventList")){
stop("The argument should be an object of class 'ISOInstrumentationEventList'")
}
return(self$addListElement("history", instrumentEventList))
},

#'@description Adds instrumentation event list
#'@param instrumentEventList object of class \link{ISOInstrumentationEventList}
#'@return \code{TRUE} if deleted, \code{FALSE} otherwise
delInstrumentationEventList = function(instrumentEventList){
if(!is(instrumentEventList, "ISOInstrumentationEventList")){
stop("The argument should be an object of class 'ISOInstrumentationEventList'")
}
return(self$delListElement("history", instrumentEventList))
}

)
Expand Down
9 changes: 7 additions & 2 deletions R/ISOImageryMetadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@
#' }
#'
#' @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_Metadata}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_Metadata}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand All @@ -332,7 +334,10 @@ ISOImageryMetadata <- R6Class("ISOImageryMetadata",
private = list(
document = TRUE,
xmlElement = "MI_Metadata",
xmlNamespacePrefix = "GMI"
xmlNamespacePrefix = list(
"19139" = "GMI",
"19115-3" = "MAC"
)
),
public = list(

Expand Down
2 changes: 1 addition & 1 deletion R/ISOImageryObjective.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_Objective}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/1.0/mac/#element_MI_Objective}
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_Objective}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand Down
24 changes: 23 additions & 1 deletion R/ISOImageryOperation.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_Operation}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/1.0/mac/#element_MI_Operation}
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_Operation}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand Down Expand Up @@ -47,6 +47,10 @@ ISOImageryOperation <- R6Class("ISOImageryOperation",
plan = NULL,
#'@field significantEvent significantEvent [0..*]: ISOImageryEvent
significantEvent = list(),
#'@field otherPropertyType otherPropertyType [0..1] : ISORecordType (=> ISO 19115-3)
otherPropertyType = NULL,
#'@field otherProperty otherProperty [0..1] : ISORecord (=> ISO 19115-3)
otherProperty = NULL,

#'@description Initializes object
#'@param xml object of class \link{XMLInternalNode-class}
Expand Down Expand Up @@ -210,6 +214,24 @@ ISOImageryOperation <- R6Class("ISOImageryOperation",
stop("The argument should be an object of class 'ISOImageryEvent")
}
return(self$delListElement("significantEvent", event))
},

#'@description setOtherPropertyType
#'@param otherPropertyType otherPropertyType object of class \link{ISORecordType}
setOtherPropertyType = function(otherPropertyType){
if(!is(otherPropertyType, "ISORecordType")){
otherPropertyType = ISORecordType$new(value = otherPropertyType)
}
self$otherPropertyType = otherPropertyType
},

#'@description setOtherProperty
#'@param otherProperty otherProperty object of class \link{ISORecord}
setOtherProperty = function(otherProperty){
if(!is(otherProperty, "ISORecord")){
otherProperty = ISORecord$new(value = otherProperty)
}
self$otherProperty = otherProperty
}

)
Expand Down
2 changes: 1 addition & 1 deletion R/ISOImageryPlan.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_Plan}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/1.0/mac/#element_MI_Plan}
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_Plan}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand Down
46 changes: 45 additions & 1 deletion R/ISOImageryPlatform.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_Platform}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/1.0/mac/#element_MI_Platform}
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_Platform}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand All @@ -81,6 +81,12 @@ ISOImageryPlatform <- R6Class("ISOImageryPlatform",
sponsor =list(),
#'@field instrument instrument [0..*]: ISOImageryInstrument
instrument = list(),
#'@field otherPropertyType otherPropertyType [0..1] : ISORecordType (=> ISO 19115-3)
otherPropertyType = NULL,
#'@field otherProperty otherProperty [0..1] : ISORecord (=> ISO 19115-3)
otherProperty = NULL,
#'@field history history [0..*] : ISOInstrumentationEventList (=> ISO 19115-3)
history = list(),

#'@description Initializes object
#'@param xml object of class \link{XMLInternalNode-class}
Expand Down Expand Up @@ -169,6 +175,44 @@ ISOImageryPlatform <- R6Class("ISOImageryPlatform",
stop("The argument should be an object of class 'ISOImageryInstrument'")
}
return(self$delListElement("instrument", instrument))
},

#'@description setOtherPropertyType
#'@param otherPropertyType otherPropertyType object of class \link{ISORecordType}
setOtherPropertyType = function(otherPropertyType){
if(!is(otherPropertyType, "ISORecordType")){
otherPropertyType = ISORecordType$new(value = otherPropertyType)
}
self$otherPropertyType = otherPropertyType
},

#'@description setOtherProperty
#'@param otherProperty otherProperty object of class \link{ISORecord}
setOtherProperty = function(otherProperty){
if(!is(otherProperty, "ISORecord")){
otherProperty = ISORecord$new(value = otherProperty)
}
self$otherProperty = otherProperty
},

#'@description Adds instrumentation event list
#'@param instrumentEventList object of class \link{ISOInstrumentationEventList}
#'@return \code{TRUE} if added, \code{FALSE} otherwise
addInstrumentationEventList = function(instrumentEventList){
if(!is(instrumentEventList, "ISOInstrumentationEventList")){
stop("The argument should be an object of class 'ISOInstrumentationEventList'")
}
return(self$addListElement("history", instrumentEventList))
},

#'@description Adds instrumentation event list
#'@param instrumentEventList object of class \link{ISOInstrumentationEventList}
#'@return \code{TRUE} if deleted, \code{FALSE} otherwise
delInstrumentationEventList = function(instrumentEventList){
if(!is(instrumentEventList, "ISOInstrumentationEventList")){
stop("The argument should be an object of class 'ISOInstrumentationEventList'")
}
return(self$delListElement("history", instrumentEventList))
}

)
Expand Down
2 changes: 1 addition & 1 deletion R/ISOImageryPlatformPass.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_PlatformPass}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/1.0/mac/#element_MI_PlatformPass}
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_PlatformPass}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand Down
2 changes: 1 addition & 1 deletion R/ISOImageryRequestedDate.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_RequestedDate}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/1.0/mac/#element_MI_RequestedDate}
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_RequestedDate}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand Down
2 changes: 1 addition & 1 deletion R/ISOImageryRequirement.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_Requirement}
#'
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/1.0/mac/#element_MI_Requirement}
#' - 19115-3 \url{https://schemas.isotc211.org/19115/-3/mac/2.0/mac/#element_MI_Requirement}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
Expand Down
Loading

0 comments on commit 728a0ec

Please sign in to comment.