Learn R Programming

geometa (version 0.4-0)

ISOFeatureCatalogue: ISOFeatureCatalogue

Description

ISOFeatureCatalogue

Usage

ISOFeatureCatalogue

Arguments

Value

Object of R6Class for modelling an ISO FeatureCatalogue

Format

R6Class object.

Fields

name

Inherited Methods from <code>ISOAbstractCatalogue</code>

setName(name)

Sets the name

addScope(scope)

Adds scope (object of class character)

delScope(scope)

Deletes scope

addFieldOfApplication(fieldOfApplication)

Adds a field of application (object of class character)

delFieldOfApplication(fieldOfApplication)

Deletes fieldOfApplication

setVersionNumber(versionNumber)

Sets version number (object of class character)

setVersionDate(versionDate)

Sets version date

Methods

new(xml, uuid)

This method is used to instantiate an ISOFeatureCatalogue

setProducer(producer)

Sets an object of class ISOResponsibleParty as producer

setFunctionalLanguage(functionalLanguage)

Sets the functional language

addFeatureType(featureType)

Adds a feature type, object of class ISOFeatureType

delFeatureType(featureType)

Deletes a feature type, object of class ISOFeatureType

addDefinitionSource(source)

Adds a definition source, object of class ISODefinitionSource or ISOCitation

delDefinitionSource(source)

Deletes a definition source, object of class ISODefinitionSource or ISOCitation

References

ISO 19110:2005 Methodology for Feature cataloguing

Examples

Run this code
# NOT RUN {
 fc <- ISOFeatureCatalogue$new(uuid = "my-fc-identifier")
 fc$setName("name")
 fc$addScope("scope1")
 fc$addScope("scope2")
 fc$addFieldOfApplication("field1")
 fc$addFieldOfApplication("field2")
 fc$setVersionNumber("1.0")
 fc$setVersionDate(ISOdate(2015, 1, 1, 1))
 
 producer <- ISOResponsibleParty$new()
 producer$setIndividualName("someone")
 fc$setProducer(producer)
 fc$setFunctionalLanguage("eng")
 
 cit <- ISOCitation$new()
 cit$setTitle("some citation title")
 fc$addDefinitionSource(cit)
 #'  #add featureType
 ft <- ISOFeatureType$new()
 ft$setTypeName("typeName")
 ft$setDefinition("definition")
 ft$setCode("code")
 ft$setIsAbstract(FALSE)
 ft$addAlias("alias1")
 ft$addAlias("alias2")
 
 #add feature attributes
 for(i in 1:3){
   #create attribute
   fat <- ISOFeatureAttribute$new()
   fat$setMemberName(sprintf("name %s",i))
   fat$setDefinition(sprintf("definition %s",i))
   fat$setCardinality(lower=1,upper=1)
   fat$setCode(sprintf("code %s",i))
   
   gml <- GMLBaseUnit$new(id = sprintf("ID%s",i))
   gml$setDescriptionReference("someref")
   gml$setIdentifier("identifier", "codespace")
   gml$addName("name1", "codespace")
   gml$addName("name2", "codespace")
   gml$setQuantityTypeReference("someref")
   gml$setCatalogSymbol("symbol")
   gml$setUnitsSystem("somelink")
   fat$setValueMeasurementUnit(gml)
   
   #add listed values
   val1 <- ISOListedValue$new()
   val1$setCode("code1")
   val1$setLabel("label1")
   val1$setDefinition("definition1")
   fat$addListedValue(val1)
   val2 <- ISOListedValue$new()
   val2$setCode("code2")
   val2$setLabel("label2")
   val2$setDefinition("definition2")
   fat$addListedValue(val2)
   fat$setValueType("typeName")
   
   #add feature attribute as carrierOfCharacteristic
   ft$addCharacteristic(fat)
 }
 #add featureType to catalogue
 fc$addFeatureType(ft)
 
 xml <- fc$encode()
 
# }

Run the code above in your browser using DataLab