-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#154 QE_CoverageResult, QE_Usability, LE_NominalResolution
- Loading branch information
Showing
12 changed files
with
450 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | ||
|
||
}) |
Oops, something went wrong.