From 40f3fdfefcd4ff6ff7a1d285cb48086eab3838bc Mon Sep 17 00:00:00 2001 From: eblondel Date: Thu, 16 Apr 2020 23:50:50 +0200 Subject: [PATCH] fix minoccurs/maxoccurs --- R/geoflow_action_geometa_create_iso_19110.R | 2 ++ R/geoflow_featuremember.R | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/R/geoflow_action_geometa_create_iso_19110.R b/R/geoflow_action_geometa_create_iso_19110.R index 6c1e09a6..42233794 100644 --- a/R/geoflow_action_geometa_create_iso_19110.R +++ b/R/geoflow_action_geometa_create_iso_19110.R @@ -155,6 +155,8 @@ geometa_create_iso_19110 <- function(entity, config, options){ fat$setDefinition(fat_attr$def) minOccurs <- default_min_occurs; if(!is.null(fat_attr)) minOccurs <- fat_attr$minOccurs maxOccurs <- default_max_occurs; if(!is.null(fat_attr)) maxOccurs <- fat_attr$maxOccurs + if(is.null(minOccurs)) minOccurs <- default_min_occurs + if(is.null(maxOccurs)) maxOccurs <- default_max_occurs if(maxOccurs == "Inf") maxOccurs <- Inf fat$setCardinality(lower = minOccurs, upper = maxOccurs) #code diff --git a/R/geoflow_featuremember.R b/R/geoflow_featuremember.R index 4b025ed1..e285fe49 100644 --- a/R/geoflow_featuremember.R +++ b/R/geoflow_featuremember.R @@ -32,11 +32,11 @@ geoflow_featuremember <- R6Class("geoflow_featuremember", name = NULL, def = NULL, defSource = NULL, - minOccurs = 1L, - maxOccurs = 1L, + minOccurs = NULL, + maxOccurs = NULL, registerId = NULL, initialize = function(type, code, name, def, defSource = NULL, - minOccurs = 1L, maxOccurs = 1L, + minOccurs = NULL, maxOccurs = NULL, registerId = NULL){ if(!type %in% c("attribute", "variable")){ stop("The member type should be either 'attribute' or 'variable'")