Skip to content

Commit

Permalink
#152 MI_PlatformPass -> ISOImageryPlatformPass, MI_AcquisitionInforma…
Browse files Browse the repository at this point in the history
…tion -> ISOImageryAcquisitionInformation
  • Loading branch information
eblondel committed Jun 10, 2019
1 parent adb47fc commit cb05e84
Show file tree
Hide file tree
Showing 9 changed files with 517 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export(ISOIdentification)
export(ISOIdentifier)
export(ISOImageDescription)
export(ISOImageryAbstractGeolocationInformation)
export(ISOImageryAcquisitionInformation)
export(ISOImageryAlgorithm)
export(ISOImageryBand)
export(ISOImageryBandDefinition)
Expand All @@ -210,6 +211,7 @@ export(ISOImageryObjectiveType)
export(ISOImageryOperationType)
export(ISOImageryPlan)
export(ISOImageryPlatform)
export(ISOImageryPlatformPass)
export(ISOImageryPolarisationOrientation)
export(ISOImageryPriority)
export(ISOImageryProcessStep)
Expand Down
208 changes: 208 additions & 0 deletions R/ISOImageryAcquisitionInformation.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
#' ISOImageryAcquisitionInformation
#'
#' @docType class
#' @importFrom R6 R6Class
#' @import XML
#' @export
#' @keywords ISO imagery AcquisitionInformation element
#' @return Object of \code{\link{R6Class}} for modelling an ISO Imagery AcquisitionInformation
#' @format \code{\link{R6Class}} object.
#'
#' @field instrument [\code{list} of \code{\link{ISOImageryInstrument}}]
#' @field operation [\code{list} of \code{\link{ISOImageryOperation}}]
#' @field platform [\code{list} of \code{\link{ISOImageryPlatform}}]
#' @field acquisitionPlan [\code{list} of \code{\link{ISOImageryPlan}}]
#' @field objective [\code{list} of \code{\link{ISOImageryObjective}}]
#' @field acquisitionRequirement [\code{list} of \code{\link{ISOImageryRequirement}}]
#' @field environmentConditions [\code{\link{ISOImageryEnvironmentalRecord}}]
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml)}}{
#' This method is used to instantiate an \code{\link{ISOImageryAcquisitionInformation}}
#' }
#' \item{\code{addInstrument(instrument)}}{
#' Adds instrument, object of class \code{\link{ISOImageryInstrument}}
#' }
#' \item{\code{delInstrument(instrument)}}{
#' Deletes instrument, object of class \code{\link{ISOImageryInstrument}}
#' }
#' \item{\code{addOperation(operation)}}{
#' Adds instrument, object of class \code{\link{ISOImageryOperation}}
#' }
#' \item{\code{delOperation(operation)}}{
#' Deletes operation, object of class \code{\link{ISOImageryOperation}}
#' }
#' \item{\code{addPlatform(platform)}}{
#' Adds platform, object of class \code{\link{ISOImageryPlatform}}
#' }
#' \item{\code{delPlatform(platform)}}{
#' Deletes platform, object of class \code{\link{ISOImageryPlatform}}
#' }
#' \item{\code{addPlan(plan)}}{
#' Adds plan, object of class \code{\link{ISOImageryPlan}}
#' }
#' \item{\code{delPlan(plan)}}{
#' Deletes plan, object of class \code{\link{ISOImageryPlan}}
#' }
#' \item{\code{addObjective(objective)}}{
#' Adds objective, object of class \code{\link{ISOImageryObjective}}
#' }
#' \item{\code{delObjective(objective)}}{
#' Deletes objective, object of class \code{\link{ISOImageryObjective}}
#' }
#' \item{\code{addRequirement(requirement)}}{
#' Adds requirement, object of class \code{\link{ISOImageryRequirement}}
#' }
#' \item{\code{delRequirement(requirement)}}{
#' Deletes requirement, object of class \code{\link{ISOImageryRequirement}}
#' }
#' \item{\code{setEnvironmentConditions(conditions)}}{
#' Set environment conditions, object of class \code{\link{ISOImageryEnvironmentalRecord}}
#' }
#' }
#'
#' @examples
#' md = ISOImageryAcquisitionInformation$new()
#'
#' xml <- md$encode()
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- AcquisitionInformation -- Part 2: Extensions for imagery and gridded data
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryAcquisitionInformation <- R6Class("ISOImageryAcquisitionInformation",
inherit = ISOAbstractObject,
private = list(
document = TRUE,
xmlElement = "MI_AcquisitionInformation",
xmlNamespacePrefix = "GMI"
),
public = list(

#+ instrument [0..*]: ISOImageryInstrument
instrument = list(),
#+ operation [0..*]: ISOImageryOperation
operation = list(),
#+ platform [0..*]: ISOImageryPlatform
platform = list(),
#+ acquisitionPlan [0..*]: ISOImageryPlan
acquisitionPlan = list(),
#+ objective [0..*]: ISOImageryObjective
objective = list(),
#+ acquisitionRequirement [0..*]: ISOImageryRequirement
acquisitionRequirement = list(),
#+ environmentalConditions [0..1]: ISOImageryEnvironmentalRecord
environmentalConditions = NULL,

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

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

#delInstrument
delInstrument = function(instrument){
if(!is(instrument, "ISOImageryInstrument")){
stop("The argument should be an object of class 'ISOImageryInstrumenet")
}
return(self$delListElement("instrument", instrument))
},

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

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

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

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

#addPlan
addPlan = function(plan){
if(!is(plan, "ISOImageryPlan")){
stop("The argument should be an object of class 'ISOImageryPlan")
}
return(self$addListElement("aquisitionPlan", plan))
},

#delPlan
delPlan = function(plan){
if(!is(plan, "ISOImageryPlan")){
stop("The argument should be an object of class 'ISOImageryPlan")
}
return(self$delListElement("acquisitionPlan", plan))
},

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

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

#addRequirement
addRequirement = function(requirement){
if(!is(requirement, "ISOImageryRequirement")){
stop("The argument should be an object of class 'ISOImageryRequirement")
}
return(self$addListElement("aquisitionRequirement", requirement))
},

#delRequirement
delRequirement = function(requirement){
if(!is(requirement, "ISOImageryRequirement")){
stop("The argument should be an object of class 'ISOImageryRequirement")
}
return(self$delListElement("acquisitionRequirement", requirement))
},

#setEnvironmentConditions
setEnvironmentConditions = function(conditions){
if(!is(conditions, "ISOImageryEnvironmentalRecord")){
stop("The argument should be an object of class 'ISOImageryEnvironmentalRecord")
}
self$environmentCondition <- conditions
}

)
)
108 changes: 108 additions & 0 deletions R/ISOImageryPlatformPass.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#' ISOImageryPlatformPass
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO imagery PlatformPass
#' @return Object of \code{\link{R6Class}} for modelling an ISO imagery PlatformPass
#' @format \code{\link{R6Class}} object.
#'
#' @field identifier [\code{\link{ISOMetaIdentifier}}]
#' @field extent [?]
#' @field relatedEvent [\code{list} of \code{\link{ISOImageryEvent}}]
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml)}}{
#' This method is used to instantiate an \code{\link{ISOImageryPlatformPass}}
#' }
#' \item{\code{setIdentifier(identifier)}}{
#' Sets an identifier, object of class \code{character} or \code{\link{ISOMetaIdentifier}}
#' }
#' \item{\code{setExtent(extent)}}{
#' Set the extent
#' }
#' \item{\code{addEvent(event)}}{
#' Add a event, object of class \code{\link{ISOImageryEvent}}
#' }
#' \item{\code{delEvent(event)}}{
#' Deletes a event, object of class \code{\link{ISOImageryEvent}}
#' }
#' }
#'
#' @examples
#' md <- ISOImageryPlatformPass$new()
#' md$setIdentifier("identifier")
#'
#' outer = matrix(c(0,0,10,0,10,10,0,10,0,0),ncol=2, byrow=TRUE)
#' hole1 = matrix(c(1,1,1,2,2,2,2,1,1,1),ncol=2, byrow=TRUE)
#' hole2 = matrix(c(5,5,5,6,6,6,6,5,5,5),ncol=2, byrow=TRUE)
#' pts = list(outer, hole1, hole2)
#' pl = st_polygon(pts)
#' md$setExtent(pl)
#'
#' 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>
#'
ISOImageryPlatformPass <- R6Class("ISOImageryPlatformPass",
inherit = ISOAbstractObject,
private = list(
xmlElement = "MI_PlatformPass",
xmlNamespacePrefix = "GMI"
),
public = list(

#+ identifier [1..1]: ISOMetaIdentifier
identifier = NULL,
#+ extent [0..1]: ?
extent = NULL,
#relatedEvent [0..*]: ISOImageryEvent
relatedEvent = list(),

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

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

#setExtent
setExtent = function(extent){
if(is(extent,"sfg")) extent <- GMLAbstractGeometry$fromSimpleFeatureGeometry(extent)
if(!inherits(extent, "GMLAbstractGeometry")){
stop("Input is not a geometry")
}
self$extent <- extent
},

#addEvent
addEvent = function(event){
if(!is(event, "ISOImageryEvent")){
stop("The argument should be an object of class 'ISOImagery")
}
return(self$addListElement("relatedEvent", event))
},

#delEvent
delEvent = function(event){
if(!is(event, "ISOImageryEvent")){
stop("The argument should be an object of class 'ISOImagery")
}
return(self$delListElement("relatedEvent", event))
}

)
)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ We thank in advance people that use ``geometa`` for citing it in their work / pu
|:------------------------------------|:-----------------------------------------------------------------------------------|:---------|:-------------------------------------------------------------------------------------------------------------------------------|---------:|-------:|
|ISO/TC211 19110:2005 |Geographic Information - Methodology for feature cataloguing |GFC |[![ISO/TC211 19110:2005](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa) | 17| 0|
|ISO/TC211 19115-1:2003 |Geographic Information - Metadata |GMD |[![ISO/TC211 19115-1:2003](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa) | 132| 0|
|ISO/TC211 19115-2:2009 |Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data |GMI |[![ISO/TC211 19115-2:2009](https://img.shields.io/badge/-90%25-33cc7a.svg)](https://github.com/eblondel/geometa) | 36| 4|
|ISO/TC211 19115-2:2009 |Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data |GMI |[![ISO/TC211 19115-2:2009](https://img.shields.io/badge/-95%25-33cc7a.svg)](https://github.com/eblondel/geometa) | 38| 2|
|ISO/TC211 19119:2005 |Geographic Information - Service Metadata |SRV |[![ISO/TC211 19119:2005](https://img.shields.io/badge/-37%25-ff0c0c.svg)](https://github.com/eblondel/geometa) | 7| 12|
|ISO/TC211 19139:2007 |Geographic Metadata XML Schema |GMX |[![ISO/TC211 19139:2007](https://img.shields.io/badge/-8%25-ad0f0f.svg)](https://github.com/eblondel/geometa) | 5| 61|
|ISO/TS 19103:2005 |Geographic Common extensible markup language |GCO |[![ISO/TS 19103:2005](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa) | 22| 0|
Expand Down
4 changes: 2 additions & 2 deletions inst/extdata/coverage/geometa_coverage_inventory.csv
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","LE_ProcessStep","ISOImageryProcessStep",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","LE_ProcessStepReport","ISOImageryProcessStepReport",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","LE_Source","ISOImagerySource",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_AcquisitionInformation","<missing>",FALSE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_AcquisitionInformation","ISOImageryAcquisitionInformation",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_Band","ISOImageryBand",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_BandDefinition","ISOImageryBandDefinition",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_ContextCode","ISOImageryContext",TRUE
Expand All @@ -176,7 +176,7 @@
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_OperationTypeCode","ISOImageryOperationType",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_Plan","ISOImageryPlan",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_Platform","ISOImageryPlatform",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_PlatformPass","<missing>",FALSE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_PlatformPass","ISOImageryPlatformPass",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_PolarisationOrientationCode","ISOImageryPolarisationOrientation",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_PriorityCode","ISOImageryPriority",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_RangeElementDescription","ISOImageryRangeElementDescription",TRUE
Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/coverage/geometa_coverage_summary.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"Standard","Title","Namespace","Supported","Missing","Coverage"
"ISO/TC211 19110:2005","Geographic Information - Methodology for feature cataloguing","GFC",17,0,100
"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",36,4,90
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI",38,2,95
"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
Expand Down
Loading

0 comments on commit cb05e84

Please sign in to comment.