Skip to content

Commit

Permalink
fix tests/rdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Dec 31, 2024
1 parent cebf428 commit 731cf09
Show file tree
Hide file tree
Showing 77 changed files with 1,531 additions and 84 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
^.*\.Rproj$
^.*\.REnviron$
^\.Rproj\.user$
^CODE_OF_CONDUCT\.md$
^CONTRIBUTING\.md$
Expand Down
4 changes: 3 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export(ISOBoundAssociationRole)
export(ISOBoundFeatureAttribute)
export(ISOBoundingPolygon)
export(ISOBrowseGraphic)
export(ISOCTCodelistValue)
export(ISOCarrierOfCharacteristics)
export(ISOCellGeometry)
export(ISOCharacterSet)
Expand All @@ -169,7 +170,6 @@ export(ISOCodeListDictionary)
export(ISOCodeListValue)
export(ISOCodelist)
export(ISOCodelistCatalogue)
export(ISOCTCodelistValue)
export(ISOCompletenessCommission)
export(ISOCompletenessOmission)
export(ISOConceptualConsistency)
Expand Down Expand Up @@ -213,6 +213,8 @@ export(ISOEvaluationMethodType)
export(ISOExtendedElementInformation)
export(ISOExtent)
export(ISOFeatureAssociation)
export(ISOFeatureAssociation19115_3)
export(ISOFeatureAssociation19139)
export(ISOFeatureAttribute)
export(ISOFeatureCatalogue)
export(ISOFeatureCatalogueDescription)
Expand Down
1 change: 1 addition & 0 deletions R/ISOCTCodelistValue.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#' @name ISOCTCodelistValue
#' @title ISOCTCodelistValue
#'
#' @docType class
#' @importFrom R6 R6Class
Expand Down
3 changes: 2 additions & 1 deletion R/ISOCodeListValue.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#' @name ISOCodeListValue
#' @title ISOCodeListValue
#'
#' @docType class
#' @importFrom R6 R6Class
Expand All @@ -18,7 +19,7 @@ ISOCodeListValue <- R6Class("ISOCodeListValue",
inherit = ISOAbstractObject,
private = list(
printAttrs = list(),
xmlElement = "CodeListItem",
xmlElement = "CodeListValue",
xmlNamespacePrefix = "GCO"
),
public = list(
Expand Down
116 changes: 116 additions & 0 deletions R/ISOFeatureAssociation.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,119 @@ ISOFeatureAssociation <- R6Class("ISOFeatureAssociation",

)
)

#' ISOFeatureAssociation19139
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO feature association
#' @return Object of \code{\link[R6]{R6Class}} for modelling an ISOFeatureAssociation in ISO 19139
#' @format \code{\link[R6]{R6Class}} object.
#'
#' @references
#' ISO 19110:2005 Methodology for Feature cataloguing
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOFeatureAssociation19139 <- R6Class("ISOFeatureAssociation19139",
inherit = ISOFeatureType19139,
private = list(
xmlElement = "FC_FeatureAssociation",
xmlNamespacePrefix = "GFC"
),
public = list(

#'@field roleName roleName [2..*]: ISOAssociationRole
roleName = list(),

#'@description Initializes object
#'@param xml object of class \link[XML]{XMLInternalNode-class}
initialize = function(xml = NULL){
super$initialize(xml = xml)
},

#'@description Adds role name
#'@param associationRole object of class \link{ISOAssociationRole}
#'@return \code{TRUE} if added, \code{FALSE} otherwise
addRoleName = function(associationRole){
if(!is(associationRole, "ISOAssociationRole")){
stop("The argument value should be an object of class 'ISOAssocationRole'")
}
return(self$addListElement("roleName", associationRole))
},

#'@description Deletes role name
#'@param associationRole object of class \link{ISOAssociationRole}
#'@return \code{TRUE} if deleted, \code{FALSE} otherwise
delRoleName = function(associationRole){
if(!is(associationRole, "ISOAssociationRole")){
stop("The argument value should be an object of class 'ISOAssocationRole'")
}
return(self$delListElement("roleName", associationRole))
}

)
)

#' ISOFeatureAssociation19115_3
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO feature association
#' @return Object of \code{\link[R6]{R6Class}} for modelling an ISOFeatureAssociation in ISO 19115-3
#' @format \code{\link[R6]{R6Class}} object.
#'
#' @references
#' ISO 19110:2005 Methodology for Feature cataloguing
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISOFeatureAssociation19115_3 <- R6Class("ISOFeatureAssociation19115_3",
inherit = ISOFeatureType19115_3,
private = list(
xmlElement = "FC_FeatureAssociation",
xmlNamespacePrefix = "GFC"
),
public = list(

#'@field roleName roleName [2..*]: ISOAssociationRole
roleName = list(),

#'@description Initializes object
#'@param xml object of class \link[XML]{XMLInternalNode-class}
initialize = function(xml = NULL){
super$initialize(xml = xml)
},

#'@description Adds role name
#'@param associationRole object of class \link{ISOAssociationRole}
#'@return \code{TRUE} if added, \code{FALSE} otherwise
addRoleName = function(associationRole){
if(!is(associationRole, "ISOAssociationRole")){
stop("The argument value should be an object of class 'ISOAssocationRole'")
}
return(self$addListElement("roleName", associationRole))
},

#'@description Deletes role name
#'@param associationRole object of class \link{ISOAssociationRole}
#'@return \code{TRUE} if deleted, \code{FALSE} otherwise
delRoleName = function(associationRole){
if(!is(associationRole, "ISOAssociationRole")){
stop("The argument value should be an object of class 'ISOAssocationRole'")
}
return(self$delListElement("roleName", associationRole))
}

)
)

ISOFeatureAssociation$new = function(xml = NULL){
self <- switch(getMetadataStandard(),
"19139" = ISOFeatureAssociation19139$new(xml = xml),
"19115-3" = ISOFeatureAssociation19115_3$new(xml = xml)
)
return(self)
}
2 changes: 1 addition & 1 deletion R/ISOFeatureCatalogueDescription.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' contact$setOnlineResource(fcLink)
#' rp = ISOResponsibleParty$new()
#' rp$setContactInfo(contact)
#' cit$setCitedResponsibleParty(rp)
#' cit$addCitedResponsibleParty(rp)
#' md$addFeatureCatalogueCitation(cit)
#'
#' @references
Expand Down
2 changes: 2 additions & 0 deletions R/ISOFeatureType19115_3.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' @format \code{\link[R6]{R6Class}} object.
#'
#' @examples
#' setMetadataStandard("19115-3") #required
#' #featuretype
#' md <- ISOFeatureType$new()
#' md$setTypeName("typeName")
Expand Down Expand Up @@ -55,6 +56,7 @@
#' md$addCharacteristic(fat)
#' }
#' xml <- md$encode()
#' setMetadataStandard("19139")
#'
#' @references
#' - ISO 19110 - GFC 1.1 https://schemas.isotc211.org/19110/gfc/1.1/gfc/#element_FC_FeatureType
Expand Down
2 changes: 1 addition & 1 deletion R/ISOImageryMetadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
#'
#' #create dataQuality object with a 'dataset' scope
#' dq <- ISODataQuality$new()
#' scope <- ISOScopeCode$new()
#' scope <- ISODataQualityScope$new()
#' scope$setLevel("dataset")
#' dq$setScope(scope)
#'
Expand Down
6 changes: 3 additions & 3 deletions R/ISOImagerySensorType.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' @format \code{\link[R6]{R6Class}} object.
#'
#' @examples
#' md <- ISOImagerySensorType$new()
#' md <- ISOImagerySensorType$new(value ="type")
#'
#' @references
#' - 19139 \url{https://schemas.isotc211.org/19115/-2/gmi/1.0/gmi/#element_MI_SensoryTypeCode}
Expand All @@ -32,9 +32,9 @@ ISOImagerySensorType <- R6Class("ISOImagerySensorType",
#'@param xml object of class \link[XML]{XMLInternalNode-class}
#'@param value value
#'@param description description
initialize = function(xml = NULL, value, description = NULL){
initialize = function(xml = NULL, value = NULL, description = NULL){
super$initialize(xml = xml, id = private$xmlElement, value = value, description = description,
addCodeSpaceAttr = FALSE)
addCodeListAttrs = FALSE,addCodeSpaceAttr = FALSE)
}
)
)
Expand Down
3 changes: 1 addition & 2 deletions R/ISOPixelOrientation.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ ISOPixelOrientation <- R6Class("ISOPixelOrientation",
#'@param description description
initialize = function(xml = NULL, value, description = NULL){
super$initialize(xml = xml, id = private$xmlElement, value = value, description = description,
addCodeSpaceAttr = FALSE)
self$attrs <- list()
addCodeListAttrs = FALSE, addCodeSpaceAttr = FALSE)
}
)
)
Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/examples/metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ md$setDistributionInfo(distrib)

#create dataQuality object with a 'dataset' scope
dq <- ISODataQuality$new()
scope <- ISOScopeCode$new()
scope <- ISODataQualityScope$new()
scope$setLevel("dataset")
dq$setScope(scope)

Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/examples/metadata_i18n.R
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ md$setDistributionInfo(distrib)
dq <- ISODataQuality$new()

#add scope
scope <- ISOScopeCode$new()
scope <- ISODataQualityScope$new()
scope$setLevel("dataset")
dq$setScope(scope)

Expand Down
2 changes: 1 addition & 1 deletion man/ISOAssociationType.Rd

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

118 changes: 118 additions & 0 deletions man/ISOCTCodelistValue.Rd

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

2 changes: 1 addition & 1 deletion man/ISOCellGeometry.Rd

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

Loading

0 comments on commit 731cf09

Please sign in to comment.