Skip to content

Commit

Permalink
added mapping of signal name
Browse files Browse the repository at this point in the history
  • Loading branch information
benediktschwab committed Apr 7, 2024
1 parent 7144549 commit d7ce4be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class CityFurnitureModuleBuilder(
// semantics
IdentifierAdder.addIdentifier(
roadspaceObject.id.deriveGmlIdentifier(parameters.gmlIdPrefix),
roadspaceObject.name,
cityFurnitureFeature
)
relationAdder.addBelongToRelations(roadspaceObject, cityFurnitureFeature)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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<String>, 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
Expand Down

0 comments on commit d7ce4be

Please sign in to comment.