-
Notifications
You must be signed in to change notification settings - Fork 5
/
GMLReferenceableGridByVectors.R
78 lines (74 loc) · 2.54 KB
/
GMLReferenceableGridByVectors.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#' GMLReferenceableGridByVectors
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO GML Grid
#' @return Object of \code{\link{R6Class}} for modelling an GML ReferenceableGridByVectors
#' @format \code{\link{R6Class}} object.
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml, element, attrs, defaults)}}{
#' This method is used to instantiate a GML ReferenceableGridByVectors
#' }
#' \item{\code{setOrigin(coords)}}{
#' Set the grid origin coordinates
#' }
#' \item{\code{addGeneralGridAxis(axis)}}{
#' Add a general grid axis definition, object of class \code{GMLGeneralGridAxis}.
#' Returns \code{TRUE} if added, \code{FALSE} otherwise.
#' }
#' \item{\code{delGeneralGridAxis(axis)}}{
#' Deletes a ageneral grid axis definition, object of class \code{GMLGeneralGridAxis}.
#' Returns \code{TRUE} if deleted, \code{FALSE} otherwise.
#' }
#' }
#'
#' @note Class used internally by geometa
#'
#' @references
#' OGC Geography Markup Language. http://www.opengeospatial.org/standards/gml
#'
#' OGC GML 3.3 Schema. http://schemas.opengis.net/gml/3.3/referenceableGrid.xsd
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
GMLReferenceableGridByVectors <- R6Class("GMLReferenceableGridByVectors",
inherit = GMLAbstractReferenceableGrid,
private = list(
xmlElement = "ReferenceableGridByVectors",
xmlNamespacePrefix = "GMLRGRID"
),
public = list(
origin = NULL,
generalGridAxis = list(),
initialize = function(xml = NULL, element = NULL, attrs = list(),
defaults = list(), wrap = TRUE){
if(is.null(element)) element <- private$xmlElement
super$initialize(xml, element = element, attrs = attrs,
defaults = defaults, wrap = wrap)
},
#setOrigin
setOrigin = function(coords){
if(!is.list(coords)){
stop("The argument 'coords' should be a list")
}
self$origin <- GMLPoint$new(m = coords)
},
#addGeneralGridAxis
addGeneralGridAxis = function(axis){
if(!is(axis, "GMLGeneralGridAxis")){
stop("The argument 'axis' should be an object of class 'GMLGeneralGridAxis")
}
return(self$addListElement("generalGridAxis", axis))
},
#delGeneralGridAxis
delGeneralGridAxis = function(axis){
if(!is(axis, "GMLGeneralGridAxis")){
stop("The argument 'axis' should be an object of class 'GMLGeneralGridAxis")
}
return(self$delListElement("generalGridAxis", axis))
}
)
)