-
Notifications
You must be signed in to change notification settings - Fork 5
/
GMLAbstractGML.R
95 lines (90 loc) · 2.99 KB
/
GMLAbstractGML.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#' GMLAbstractGML
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO GML
#' @return Object of \code{\link{R6Class}} for modelling an GML abstract GML
#' @format \code{\link{R6Class}} object.
#'
#' @field descriptionReference [\code{\link{GMLElement}}]
#' @field identifier [\code{\link{GMLElement}}]
#' @field name [\code{\link{GMLElement}}]
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(xml, element, attrs, defaults)}}{
#' This method is used to instantiate a GML abstract GML
#' }
#' \item{\code{setDescription(description)}}{
#' Set the description
#' }
#' \item{\code{setDescriptionReference(descriptionReference)}}{
#' Set the descriptionReference
#' }
#' \item{\code{setIdentifier(identifier)}}{
#' Set the identifier
#' }
#' \item{\code{addName(name)}}{
#' Adds a name
#' }
#' \item{\code{delName(name)}}{
#' Deletes a name
#' }
#' }
#'
#' @note Class used internally by geometa
#'
#' @references
#' ISO 19136:2007 Geographic Information -- Geographic Markup Language.
#' http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=32554
#'
#' OGC Geography Markup Language. http://www.opengeospatial.org/standards/gml
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
GMLAbstractGML <- R6Class("GMLAbstractGML",
inherit = GMLAbstractObject,
private = list(
xmlElement = "AbstractGML",
xmlNamespacePrefix = "GML"
),
public = list(
#+ metaDataProperty [0..*]
metaDataProperty = list(),
#+ description [0..1]
description = NULL,
#+ descriptionReference [0..1]: character
descriptionReference = NULL,
#+ identifier [0..1]: character
identifier = NULL,
#+ name [0..*]: character
name = 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)
},
#setDescription
setDescription = function(description){
self$description <- GMLElement$create("description", value = description)
},
#setDescriptionReference
setDescriptionReference = function(descriptionReference){
self$descriptionReference <- GMLElement$create("descriptionReference", href = descriptionReference)
},
#setIdentifier
setIdentifier = function(identifier, codeSpace){
self$identifier <- GMLElement$create("identifier", value = identifier, codeSpace = codeSpace)
},
#addName
addName = function(name, codeSpace = NULL){
gmlElem <- GMLElement$create("name", value = name, codeSpace = codeSpace)
return(self$addListElement("name", gmlElem))
},
#delName
delName = function(name, codeSpace = NULL){
gmlElem <- GMLElement$create("name", value = name, codeSpace = codeSpace)
return(self$delListElement("name", gmlElem))
}
)
)