Skip to content

Commit

Permalink
#154 LE_Source, LE_ProcessStep, LE_ProcessStepReport
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Jun 8, 2019
1 parent 2b5fbc5 commit 2771583
Show file tree
Hide file tree
Showing 16 changed files with 767 additions and 7 deletions.
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,15 @@ export(ISOImageryPlan)
export(ISOImageryPlatform)
export(ISOImageryPolarisationOrientation)
export(ISOImageryPriority)
export(ISOImageryProcessStep)
export(ISOImageryProcessStepReport)
export(ISOImageryProcessing)
export(ISOImageryRangeElementDescription)
export(ISOImageryRequestedDate)
export(ISOImageryRequirement)
export(ISOImagerySensorType)
export(ISOImagerySequence)
export(ISOImagerySource)
export(ISOImageryTransferFunctionType)
export(ISOImageryTrigger)
export(ISOImageryUsability)
Expand Down
10 changes: 10 additions & 0 deletions R/ISOImageryNominalResolution.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
#' }
#' }
#'
#' @examples
#' #encoding
#' dq <- ISOImageryNominalResolution$new()
#' d <- ISODistance$new(value = 1, uom = "m", useUomURI = TRUE)
#' dq$setScanningResolution(d)
#' dq$setGroundResolution(d)
#'
#' #xml
#' xml <- dq$encode()
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#'
Expand Down
178 changes: 178 additions & 0 deletions R/ISOImageryProcessStep.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
#' ISOImageryProcessStep
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO imagery process step
#' @return Object of \code{\link{R6Class}} for modelling an ISO imagery process step
#' @format \code{\link{R6Class}} object.
#'
#' @field processingInformation [\code{\link{ISOImageryProcessing}}]
#' @field output [\code{list} of \code{\link{ISOImagerySource}}]
#' @field report [\code{list} of \code{\link{ISOImageryProcessStepReport}}]
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml)}}{
#' This method is used to instantiate an \code{\link{ISOImageryProcessStep}}
#' }
#' \item{\code{setProcessingInformation(processingInfo)}}{
#' Set the processing information, object of class \code{\link{ISOImageryProcessing}}
#' }
#' \item{\code{addOutput(output)}}{
#' Add output, object of class \code{\link{ISOSource}}
#' }
#' \item{\code{delOutput(output)}}{
#' Deletes output, object of class \code{\link{ISOSource}}
#' }
#' \item{\code{addReport(report)}}{
#' Add report, object of class \code{\link{ISOImageryProcessStepReport}}
#' }
#' \item{\code{delReport(report)}}{
#' Deletes report, object of class \code{\link{ISOImageryProcessStepReport}}
#' }
#' }
#'
#' @section Methods inherited from \code{\link{ISOProcessStep}}:
#' \describe{
#' See methods description at \code{\link{ISOProcessStep}}
#' }
#'
#' @examples
#' ps <- ISOImageryProcessStep$new()
#' ps$setDescription("description")
#' ps$setRationale("rationale")
#' ps$setDateTime( ISOdate(2015, 1, 1, 23, 59, 59))
#' rp <- ISOResponsibleParty$new()
#' rp$setIndividualName("someone") #and more responsible party properties..
#' ps$addProcessor(rp)
#'
#' #specific methods to ISO 19115-2
#' process <- ISOImageryProcessing$new()
#'
#' #add citation
#' rp1 <- ISOResponsibleParty$new()
#' rp1$setIndividualName("someone1")
#' rp1$setOrganisationName("somewhere1")
#' rp1$setPositionName("someposition1")
#' rp1$setRole("pointOfContact")
#' contact1 <- ISOContact$new()
#' phone1 <- ISOTelephone$new()
#' phone1$setVoice("myphonenumber1")
#' phone1$setFacsimile("myfacsimile1")
#' contact1$setPhone(phone1)
#' address1 <- ISOAddress$new()
#' address1$setDeliveryPoint("theaddress1")
#' address1$setCity("thecity1")
#' address1$setPostalCode("111")
#' address1$setCountry("France")
#' address1$setEmail("someone1@@theorg.org")
#' contact1$setAddress(address1)
#' res <- ISOOnlineResource$new()
#' res$setLinkage("http://www.somewhereovertheweb.org")
#' res$setName("somename")
#' contact1$setOnlineResource(res)
#' rp1$setContactInfo(contact1)
#'
#' #citation
#' ct <- ISOCitation$new()
#' ct$setTitle("sometitle")
#' d <- ISODate$new()
#' d$setDate(ISOdate(2015, 1, 1, 1))
#' d$setDateType("publication")
#' ct$addDate(d)
#' ct$setEdition("1.0")
#' ct$setEditionDate(ISOdate(2015,1,1))
#' ct$setIdentifier(ISOMetaIdentifier$new(code = "identifier"))
#' ct$setPresentationForm("mapDigital")
#' ct$setCitedResponsibleParty(rp1)
#'
#' process$setIdentifier("identifier")
#' process$setProcedureDescription("some description")
#' process$addSoftwareReference(ct)
#' process$addDocumentation(ct)
#' process$setRunTimeParameters("params")
#' ps$setProcessingInformation(process)
#'
#' #output
#' trg <- ISOImagerySource$new()
#' trg$setProcessedLevel("level")
#' res <- ISOImageryNominalResolution$new()
#' d <- ISODistance$new(value = 1, uom = "m", useUomURI = TRUE)
#' res$setScanningResolution(d)
#' trg$setResolution(res)
#' ps$addOutput(trg)
#'
#' #report
#' rep <- ISOImageryProcessStepReport$new()
#' rep$setName("report")
#' rep$setDescription("description")
#' rep$setFileType("filetype")
#' ps$addReport(rep)
#'
#' xml <- ps$encode()
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryProcessStep <- R6Class("ISOImageryProcessStep",
inherit = ISOProcessStep,
private = list(
xmlElement = "LE_ProcessStep",
xmlNamespacePrefix = "GMI"
),
public = list(
#+ processingInformation [0..1]: ISOImageryProcessing
processingInformation = NULL,
#+ output [0..*]: list of ISOImagerySource
output = list(),
#+ report [0..*]: list of ISOImageryProcessStepReport
report = list(),

initialize = function(xml = NULL){
super$initialize(xml = xml)
},

#setProcessingInformation
setProcessingInformation = function(processingInfo){
if(!is(processingInfo, "ISOImageryProcessing")){
stop("The argument should be an object of class 'ISOImageryProcessing'")
}
self$processingInformation <- processingInfo
},

#addOutput
addOutput = function(output){
if(!is(output, "ISOImagerySource")){
stop("The argument should be an object of class 'ISOImagerySource")
}
return(self$addListElement("output", output))
},

#delOutput
delOutput = function(output){
if(!is(output, "ISOImagerySource")){
stop("The argument should be an object of class 'ISOImagerySource")
}
return(self$delListElement("output", output))
},

#addReport
addReport = function(report){
if(!is(report, "ISOImageryProcessStepReport")){
stop("The argument should be an object of class 'ISOImageryProcessStepReport")
}
return(self$addListElement("report", report))
},

#delReport
delReport = function(report){
if(!is(report, "ISOImageryProcessStepReport")){
stop("The argument should be an object of class 'ISOImageryProcessStepReport")
}
return(self$delListElement("report", report))
}
)
)
89 changes: 89 additions & 0 deletions R/ISOImageryProcessStepReport.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#' ISOImageryProcessStepReport
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO imagery ProcessStepReport
#' @return Object of \code{\link{R6Class}} for modelling an ISO imagery ProcessStepReport
#' @format \code{\link{R6Class}} object.
#'
#' @field name [\code{\link{character}}|\code{\link{ISOLocalisedCharacterString}}]
#' @field description [\code{\link{character}}|\code{\link{ISOLocalisedCharacterString}}]
#' @field fileType [\code{\link{character}}|\code{\link{ISOLocalisedCharacterString}}]
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml)}}{
#' This method is used to instantiate an \code{\link{ISOImageryProcessStepReport}}
#' }
#' \item{\code{setName(name, locales)}}{
#' Sets a name (object of class "character"). Locale names can be
#' specified as \code{list} with the \code{locales} argument.
#' }
#' \item{\code{setDescription(description, locales)}}{
#' Sets a description (object of class "character"). Locale names can be
#' specified as \code{list} with the \code{locales} argument.
#' }
#' \item{\code{setFileType(fileType, locales)}}{
#' Sets a fileType (object of class "character"). Locale names can be
#' specified as \code{list} with the \code{locales} argument.
#' }
#' }
#'
#' @examples
#' md <- ISOImageryProcessStepReport$new()
#' md$setName("my_report")
#' md$setDescription("description")
#' md$setFileType("md")
#' xml <- md$encode()
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryProcessStepReport <- R6Class("ISOImageryProcessStepReport",
inherit = ISOAbstractObject,
private = list(
xmlElement = "LE_ProcessStepReport",
xmlNamespacePrefix = "GMI"
),
public = list(

#+ name [1..1]: character|ISOLocalisedCharacterString
name = NULL,
#+ description [0..1]: character|ISOLocalisedCharacterString
description = NULL,
#+ fileType [0..1]: character|ISOLocalisedCharacterString
fileType = NULL,

initialize = function(xml = NULL){
super$initialize(xml = xml)
},

#setName
setName = function(name, locales = NULL){
if(!is.null(locales)){
name <- self$createLocalisedProperty(name, locales)
}
self$name <- name
},

#setDescription
setDescription = function(description, locales = NULL){
if(!is.null(locales)){
description <- self$createLocalisedProperty(description, locales)
}
self$description <- description
},

#setFileType
setFileType = function(fileType, locales = NULL){
if(!is.null(locales)){
fileType <- self$createLocalisedProperty(fileType, locales)
}
self$fileType <- fileType
}

)
)
2 changes: 1 addition & 1 deletion R/ISOImageryProcessing.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @section Methods:
#' \describe{
#' \item{\code{new(xml)}}{
#' This method is used to instantiate an \code{\link{ISOImageryPlatform}}
#' This method is used to instantiate an \code{\link{ISOImageryProcessing}}
#' }
#' \item{\code{setIdentifier(identifier)}}{
#' Sets an identifier, object of class \code{character} or \code{\link{ISOMetaIdentifier}}
Expand Down
79 changes: 79 additions & 0 deletions R/ISOImagerySource.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#' ISOImagerySource
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO imagery source
#' @return Object of \code{\link{R6Class}} for modelling an ISO imagery source
#' @format \code{\link{R6Class}} object.
#'
#' @field processedLevel [\code{\link{ISOMetaIdentifier}}]
#' @field resolution [\code{\link{ISOImageryNominalResolution}}]
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml)}}{
#' This method is used to instantiate an \code{\link{ISOImagerySource}}
#' }
#' \item{\code{setProcessedLevel(processedLevel)}}{
#' Sets processed level, object of class \code{character} or \code{\link{ISOMetaIdentifier}}
#' }
#' \item{\code{setResolution(resolution)}}{
#' Set the resolution, object of class \code{ISOImageryNominalResolution}
#' }
#' }
#'
#' @examples
#' md <- ISOImagerySource$new()
#' md$setProcessedLevel("identifier")
#' res <- ISOImageryNominalResolution$new()
#' d <- ISODistance$new(value = 1, uom = "m", useUomURI = TRUE)
#' res$setScanningResolution(d)
#' md$setResolution(res)
#'
#' xml <- md$encode()
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImagerySource <- R6Class("ISOImagerySource",
inherit = ISOAbstractObject,
private = list(
xmlElement = "LE_Source",
xmlNamespacePrefix = "GMI"
),
public = list(

#+ processedLevel [0..1]: ISOMetaIdentifier
processedLevel = NULL,
#+ resolution [0..1]: ISOImageryNominalResolution
resolution = NULL,

initialize = function(xml = NULL){
super$initialize(xml = xml)
},

#setProcessedLevel
setProcessedLevel = function(processedLevel){
if(is(processedLevel, "character")){
processedLevel <- ISOMetaIdentifier$new(code = processedLevel)
}else{
if(!is(processedLevel, "ISOMetaIdentifier")){
stop("The argument should be an object of class 'character' or 'ISOMetaIdentifier'")
}
}
self$processedLevel <- processedLevel
},

#setResolution
setResolution = function(resolution){
if(!is(resolution, "ISOImageryNominalResolution")){
stop("The argument should be an object of class 'ISOImageryNominalResolution")
}
self$resolution <- resolution
}

)
)
Loading

0 comments on commit 2771583

Please sign in to comment.