diff --git a/rtron-transformer/src/main/kotlin/io/rtron/transformer/converter/roadspaces2citygml/module/CityFurnitureModuleBuilder.kt b/rtron-transformer/src/main/kotlin/io/rtron/transformer/converter/roadspaces2citygml/module/CityFurnitureModuleBuilder.kt index f90673e..f8c4c8e 100644 --- a/rtron-transformer/src/main/kotlin/io/rtron/transformer/converter/roadspaces2citygml/module/CityFurnitureModuleBuilder.kt +++ b/rtron-transformer/src/main/kotlin/io/rtron/transformer/converter/roadspaces2citygml/module/CityFurnitureModuleBuilder.kt @@ -83,6 +83,7 @@ class CityFurnitureModuleBuilder( // semantics IdentifierAdder.addIdentifier( roadspaceObject.id.deriveGmlIdentifier(parameters.gmlIdPrefix), + roadspaceObject.name, cityFurnitureFeature ) relationAdder.addBelongToRelations(roadspaceObject, cityFurnitureFeature) diff --git a/rtron-transformer/src/main/kotlin/io/rtron/transformer/converter/roadspaces2citygml/module/IdentifierAdder.kt b/rtron-transformer/src/main/kotlin/io/rtron/transformer/converter/roadspaces2citygml/module/IdentifierAdder.kt index 3cec22f..1b21fba 100644 --- a/rtron-transformer/src/main/kotlin/io/rtron/transformer/converter/roadspaces2citygml/module/IdentifierAdder.kt +++ b/rtron-transformer/src/main/kotlin/io/rtron/transformer/converter/roadspaces2citygml/module/IdentifierAdder.kt @@ -16,6 +16,7 @@ package io.rtron.transformer.converter.roadspaces2citygml.module +import arrow.core.Option import org.citygml4j.core.model.core.AbstractCityObject import org.xmlobjects.gml.model.basictypes.Code @@ -31,6 +32,14 @@ object IdentifierAdder { dstCityObject.id = gmlId } + /** Adds the [gmlId] and optionally the [name] to the [dstCityObject]. */ + fun addIdentifier(gmlId: String, name: Option, dstCityObject: AbstractCityObject) { + dstCityObject.id = gmlId + name.onSome { + dstCityObject.names = listOf(Code(it)) + } + } + /** Adds the [gmlId] and the [name] to the [dstCityObject]. */ fun addIdentifier(gmlId: String, name: String, dstCityObject: AbstractCityObject) { dstCityObject.id = gmlId