From d7ce4beac251cacefe4ef18c9ecf47de15114bbf Mon Sep 17 00:00:00 2001 From: Benedikt Schwab Date: Sun, 7 Apr 2024 22:53:38 +0200 Subject: [PATCH] added mapping of signal name --- .../module/CityFurnitureModuleBuilder.kt | 1 + .../roadspaces2citygml/module/IdentifierAdder.kt | 9 +++++++++ 2 files changed, 10 insertions(+) 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 f90673e9..f8c4c8e2 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 3cec22fc..1b21fba6 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