Skip to content

Commit

Permalink
#154 QE_CoverageResult, QE_Usability, LE_NominalResolution
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Jun 5, 2019
1 parent aaa6f90 commit 4d191a2
Show file tree
Hide file tree
Showing 12 changed files with 450 additions and 5 deletions.
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,14 @@ export(ISOImageryBand)
export(ISOImageryBandDefinition)
export(ISOImageryContext)
export(ISOImageryCoverageDescription)
export(ISOImageryCoverageResult)
export(ISOImageryEnvironmentalRecord)
export(ISOImageryEvent)
export(ISOImageryGeometryType)
export(ISOImageryImageDescription)
export(ISOImageryInstrument)
export(ISOImageryMetadata)
export(ISOImageryNominalResolution)
export(ISOImageryObjectiveType)
export(ISOImageryOperationType)
export(ISOImageryPlan)
Expand All @@ -210,6 +212,7 @@ export(ISOImagerySensorType)
export(ISOImagerySequence)
export(ISOImageryTransferFunctionType)
export(ISOImageryTrigger)
export(ISOImageryUsability)
export(ISOImagingCondition)
export(ISOInheritanceRelation)
export(ISOInitiative)
Expand Down
38 changes: 38 additions & 0 deletions R/ISOImageryCoverageResult.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#' ISOImageryCoverageResult
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO imagery coverage result
#' @return Object of \code{\link{R6Class}} for modelling an ISO imagery coverage result
#' @format \code{\link{R6Class}} object.
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml)}}{
#' This method is used to instantiate an \code{\link{ISOImageryCoverageResult}}
#' }
#' }
#'
#' @section Methods inherited from \code{\link{ISOAbstractResult}}:
#' \describe{
#' See methods description at \code{\link{ISOAbstractResult}}
#' }
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryCoverageResult <- R6Class("ISOImageryCoverageResult",
inherit = ISOAbstractResult,
private = list(
xmlElement = "QE_CoverageResult",
xmlNamespacePrefix = "GMI"
),
public = list(
initialize = function(xml = NULL){
super$initialize(xml = xml)
}
)
)
64 changes: 64 additions & 0 deletions R/ISOImageryNominalResolution.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#' ISOImageryNominalResolution
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO imagery nominal resolution
#' @return Object of \code{\link{R6Class}} for modelling an ISO imagery nominal resolution
#' @format \code{\link{R6Class}} object.
#'
#' @field scanningResolution [\code{\link{ISODistance}}]
#' @field groundResolution [\code{\link{ISODistance}}]
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml)}}{
#' This method is used to instantiate an \code{\link{ISOImageryNominalResolution}}
#' }
#' \item{\code{setScanningResolution(resolution)}}{
#' Set the scanning resolution, object of class \code{\link{ISODistance}}
#' }
#' \item{\code{setGroundResolution(resolution)}}{
#' Set the ground resolution, object of class \code{\link{ISODistance}}
#' }
#' }
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryNominalResolution <- R6Class("ISOImageryNominalResolution",
inherit = ISODataQualityAbstractElement,
private = list(
xmlElement = "LE_NominalResolution",
xmlNamespacePrefix = "GMI"
),
public = list(
#+ scanningResolution [0..1]: ISODistance
scanningResolution = NULL,
#+ groundResolution [0..1]: ISODistance
groundResolution = NULL,
initialize = function(xml = NULL){
super$initialize(xml = xml)
},

#setScanningResolution
setScanningResolution = function(resolution){
if(!is(resolution, "ISODistance")){
stop("The argument should be an object of class 'ISODistance'")
}
self$scanningResolution <- resolution
self$groundResolution <- NULL
},

#setGroundResolution
setGroundResolution = function(resolution){
if(!is(resolution, "ISODistance")){
stop("The argument should be an object of class 'ISODistance'")
}
self$groundResolution <- resolution
self$scanningResolution <- NULL
}
)
)
38 changes: 38 additions & 0 deletions R/ISOImageryUsability.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#' ISOImageryUsability
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO imagery usability
#' @return Object of \code{\link{R6Class}} for modelling an ISO imagery usability
#' @format \code{\link{R6Class}} object.
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml)}}{
#' This method is used to instantiate an \code{\link{ISOImageryUsability}}
#' }
#' }
#'
#' @section Methods inherited from \code{\link{ISODataQualityAbstractElement}}:
#' \describe{
#' See methods description at \code{\link{ISODataQualityAbstractElement}}
#' }
#'
#' @references
#' ISO 19115-2:2009 - Geographic information -- Metadata Part 2: Extensions for imagery and gridded data
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOImageryUsability <- R6Class("ISOImageryUsability",
inherit = ISODataQualityAbstractElement,
private = list(
xmlElement = "QE_Usability",
xmlNamespacePrefix = "GMI"
),
public = list(
initialize = function(xml = NULL){
super$initialize(xml = xml)
}
)
)
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/-58%25-f9ae2c.svg)](https://github.com/eblondel/geometa) | 23| 17|
|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/-65%25-f2eb24.svg)](https://github.com/eblondel/geometa) | 26| 14|
|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/-6%25-ad0f0f.svg)](https://github.com/eblondel/geometa) | 4| 62|
|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
6 changes: 3 additions & 3 deletions inst/extdata/coverage/geometa_coverage_inventory.csv
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"ISO/TC211 19115-1:2003","Geographic Information - Metadata","GMD","URL","ISOURL",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","AbstractMI_GeolocationInformation","<missing>",FALSE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","LE_Algorithm","<missing>",FALSE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","LE_NominalResolution","<missing>",FALSE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","LE_NominalResolution","ISOImageryNominalResolution",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","LE_Processing","<missing>",FALSE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","LE_ProcessStep","<missing>",FALSE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","LE_ProcessStepReport","<missing>",FALSE
Expand Down Expand Up @@ -186,8 +186,8 @@
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_SequenceCode","ISOImagerySequence",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_TransferFunctionTypeCode","ISOImageryTransferFunctionType",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","MI_TriggerCode","ISOImageryTrigger",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","QE_CoverageResult","<missing>",FALSE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","QE_Usability","<missing>",FALSE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","QE_CoverageResult","ISOImageryCoverageResult",TRUE
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI","QE_Usability","ISOImageryUsability",TRUE
"ISO/TC211 19119:2005","Geographic Information - Service Metadata","SRV","DCPList","ISODCPList",TRUE
"ISO/TC211 19119:2005","Geographic Information - Service Metadata","SRV","SV_CoupledResource","ISOCoupledResource",TRUE
"ISO/TC211 19119:2005","Geographic Information - Service Metadata","SRV","SV_CouplingType","ISOCouplingType",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",23,17,57.5
"ISO/TC211 19115-2:2009","Geographic Information - Metadata - Part 2: Extensions for imagery and gridded data","GMI",26,14,65
"ISO/TC211 19119:2005","Geographic Information - Service Metadata","SRV",7,12,36.84
"ISO/TC211 19139:2007","Geographic Metadata XML Schema","GMX",4,62,6.06
"ISO/TS 19103:2005","Geographic Common extensible markup language","GCO",22,0,100
Expand Down
40 changes: 40 additions & 0 deletions man/ISOImageryCoverageResult.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions man/ISOImageryNominalResolution.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions man/ISOImageryUsability.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions tests/testthat/test_ISOImageryNominalResolution.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# test_ISOImageryNominalResolution.R
# Author: Emmanuel Blondel <emmanuel.blondel1@gmail.com>
#
# Description: Unit tests for ISOImageryNominalResolution.R
#=======================
require(geometa, quietly = TRUE)
require(testthat)

context("ISOImageryNominalResolution")

test_that("encoding",{
testthat::skip_on_cran()
testthat::skip_on_travis()
#encoding
dq <- ISOImageryNominalResolution$new()
d <- ISODistance$new(value = 1, uom = "m", useUomURI = TRUE)
dq$setScanningResolution(d)
expect_is(dq$scanningResolution, "ISODistance")
expect_true(is.null(dq$groundResolution))
dq$setGroundResolution(d)
expect_is(dq$groundResolution, "ISODistance")
expect_true(is.null(dq$scanningResolution))

#xml
xml <- dq$encode()
expect_is(xml, "XMLInternalNode")

#decoding
dq2 <- ISOImageryNominalResolution$new(xml = xml)
xml2 <- dq2$encode()

expect_true(ISOAbstractObject$compare(dq, dq2))

})
Loading

0 comments on commit 4d191a2

Please sign in to comment.