-
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.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
239 changed files
with
2,136 additions
and
1,990 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,8 @@ Date: 2017-06-16 | |
Author: Emmanuel Blondel <[email protected]> | ||
Maintainer: Emmanuel Blondel <[email protected]> | ||
Description: Provides facilities to handle reading and writing of geographic metadata | ||
defined with OGC/ISO 19115 and 19139 (XML) standards. | ||
defined with OGC/ISO 19115 and 19110 geographic information metadata standards, and | ||
encoded using the ISO 19139 (XML) standard. | ||
Depends: R (>= 3.1.0) | ||
Imports: R6, XML | ||
Suggests: testthat, roxygen2 | ||
|
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,92 @@ | ||
#' 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 | ||
#' @field identifier | ||
#' @field name | ||
#' | ||
#' @section Methods: | ||
#' \describe{ | ||
#' \item{\code{new(xml, element, attrs, defaults)}}{ | ||
#' This method is used to instantiate a GML abstract GML | ||
#' } | ||
#' \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( | ||
#+ 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()){ | ||
if(is.null(element)) element <- private$xmlElement | ||
super$initialize(xml, element = element, attrs = attrs, defaults = defaults) | ||
}, | ||
|
||
#setDescriptionReference | ||
setDescriptionReference = function(descriptionReference){ | ||
gmlElem <- GMLElement$new(element = "descriptionReference") | ||
gmlElem$setHref(descriptionReference) | ||
self$descriptionReference <- gmlElem | ||
}, | ||
|
||
#setIdentifier | ||
setIdentifier = function(identifier, codeSpace){ | ||
gmlElem <- GMLElement$new(element = "identifier") | ||
gmlElem$setValue(identifier) | ||
gmlElem$setCodeSpace(codeSpace) | ||
self$identifier <- gmlElem | ||
}, | ||
|
||
#addName | ||
addName = function(name, codeSpace = NULL){ | ||
gmlElem <- GMLElement$new(element = "name") | ||
if(!is.null(codeSpace)) gmlElem$setCodeSpace(codeSpace) | ||
gmlElem$setValue(name) | ||
return(self$addListElement("name", gmlElem)) | ||
}, | ||
|
||
#delName | ||
delName = function(name, codeSpace = NULL){ | ||
gmlElem <- GMLElement$new(element = "name") | ||
if(!is.null(codeSpace)) gmlElem$setCodeSpace(codeSpace) | ||
gmlElem$setValue(name) | ||
return(self$delListElement("name", gmlElem)) | ||
} | ||
) | ||
) |
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,42 @@ | ||
#' GMLAbstractObject | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO GML | ||
#' @return Object of \code{\link{R6Class}} for modelling an GML abstract object | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' | ||
#' @section Methods: | ||
#' \describe{ | ||
#' \item{\code{new(xml, element, attrs, defaults)}}{ | ||
#' This method is used to instantiate an ISOTemporalPrimitive | ||
#' } | ||
#' } | ||
#' | ||
#' @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> | ||
#' | ||
GMLAbstractObject <- R6Class("GMLAbstractObject", | ||
inherit = ISOAbstractObject, | ||
private = list( | ||
xmlElement = "AbstractObject", | ||
xmlNamespacePrefix = "GML" | ||
), | ||
public = list( | ||
initialize = function(xml = NULL, element = NULL, attrs = list(), defaults = list()){ | ||
if(is.null(element)) element <- private$xmlElement | ||
super$initialize(xml, element, namespace = private$xmlNamespacePrefix, | ||
attrs = attrs, defaults = defaults, | ||
wrap = FALSE) | ||
} | ||
) | ||
) |
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,47 @@ | ||
#' GMLAbstractTimeObject | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO GML time object abstract | ||
#' @return Object of \code{\link{R6Class}} for modelling an GML AbstractTimeObject | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' @field remarks | ||
#' | ||
#' @section Methods: | ||
#' \describe{ | ||
#' \item{\code{new(xml, defaults)}}{ | ||
#' This method is used to instantiate a GML AbstractTimeObject | ||
#' } | ||
#' \item{\code{setId(id)}}{ | ||
#' Sets the id | ||
#' } | ||
#' \item{\code{addRemark(remark)}}{ | ||
#' Adds a remark | ||
#' } | ||
#' \item{\code{delRemark(remark)}}{ | ||
#' Deletes a remark | ||
#' } | ||
#' } | ||
#' | ||
#' @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> | ||
#' | ||
GMLAbstractTimeObject <- R6Class("GMLAbstractTimeObject", | ||
inherit = GMLAbstractGML, | ||
private = list( | ||
xmlElement = "AbstractTimeObject", | ||
xmlNamespacePrefix = "GML" | ||
), | ||
public = list( | ||
initialize = function(xml = NULL, defaults = list()){ | ||
super$initialize(xml, element = private$xmlElement, defaults) | ||
} | ||
) | ||
) |
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,68 @@ | ||
#' GMLAbstractTimePrimitive | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO GML time primitive abstract | ||
#' @return Object of \code{\link{R6Class}} for modelling an GML AbstractTimePrimitive | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' @section Methods: | ||
#' \describe{ | ||
#' \item{\code{new(xml, defaults)}}{ | ||
#' This method is used to instantiate a GML AbstractTimePrimitive | ||
#' } | ||
#' \item{\code{setId(id)}}{ | ||
#' Sets the id | ||
#' } | ||
#' \item{\code{addRelatedTime(time)}}{ | ||
#' Adds related time, object of class among \code{GMLTimeInstant}, \code{GMLTimePeriod}, | ||
#' \code{GMLTimeNode} or \code{GMLTimeEdge} | ||
#' } | ||
#' \item{\code{delRelatedTime(time)}}{ | ||
#' Deletes related time | ||
#' } | ||
#' } | ||
#' | ||
#' @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> | ||
#' | ||
GMLAbstractTimePrimitive <- R6Class("GMLAbstractTimePrimitive", | ||
inherit = GMLAbstractTimeObject, | ||
private = list( | ||
xmlElement = "AbstractTimePrimitive", | ||
xmlNamespacePrefix = "GML" | ||
), | ||
public = list( | ||
initialize = function(xml = NULL, defaults = list()){ | ||
super$initialize(xml, defaults) | ||
}, | ||
|
||
#addRelatedTime | ||
addRelatedTime = function(time){ | ||
allowedClasses <- c("GMLTimeInstant", "GMLTimePeriod", | ||
"GMLTimeNode", "GMLTimeEdge") | ||
if(!(class(time)[1] %in% allowedClasses)){ | ||
stop(sprintf("The argument value should an object of class among the following classes %s", | ||
paste(allowedClasses, collapse=", "))) | ||
} | ||
return(self$addListElement("relatedTime", time)) | ||
}, | ||
|
||
#delRelatedTime | ||
delRelatedTime = function(time){ | ||
allowedClasses <- c("GMLTimeInstant", "GMLTimePeriod", | ||
"GMLTimeNode", "GMLTimeEdge") | ||
if(!(class(time)[1] %in% allowedClasses)){ | ||
stop(sprintf("The argument value should an object of class among the following classes %s", | ||
paste(allowedClasses, collapse=", "))) | ||
} | ||
return(self$delListElement("relatedTime", time)) | ||
} | ||
) | ||
) |
Oops, something went wrong.