├── .dockerignore ├── .gitattributes ├── .github ├── dependabot.yml.bak └── workflows │ ├── build-api-docs.yml │ ├── build-rtron.yml │ └── validate-gradle-wrapper.yml ├── .gitignore ├── CHANGELOG.md ├── CITATION.cff ├── Dockerfile ├── LICENSE ├── README.md ├── build.gradle.kts ├── buildSrc ├── build.gradle.kts ├── settings.gradle.kts └── src │ └── main │ └── kotlin │ ├── BuildProperties.kt │ ├── Configuration.kt │ ├── Dependencies.kt │ ├── Plugins.kt │ ├── Repositories.kt │ └── Utils.kt ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jitpack.yml ├── rtron-cli ├── README.md ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── io │ └── rtron │ └── cli │ ├── Main.kt │ ├── SubcommandOpendriveToCitygml.kt │ └── SubcommandValidateOpendrive.kt ├── rtron-io ├── README.md ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── io │ └── rtron │ └── io │ ├── csv │ └── CSVPrinter.kt │ ├── files │ ├── CompressedFileExtension.kt │ ├── FileExtensions.kt │ └── PathExtensions.kt │ ├── issues │ ├── ContextIssueList.kt │ ├── DefaultIssue.kt │ ├── DefaultIssueList.kt │ ├── IssueList.kt │ └── Severity.kt │ ├── logging │ └── ProgressBar.kt │ └── serialization │ └── JsonSerializationExtensions.kt ├── rtron-main ├── README.md ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── io │ └── rtron │ └── main │ ├── processor │ ├── CompressionFormat.kt │ ├── OpendriveToCitygmlParameters.kt │ ├── OpendriveToCitygmlProcessor.kt │ ├── ValidateOpendriveParameters.kt │ └── ValidateOpendriveProcessor.kt │ └── project │ ├── Project.kt │ └── ProjectDSL.kt ├── rtron-math ├── README.md ├── build.gradle.kts └── src │ ├── main │ └── kotlin │ │ └── io │ │ └── rtron │ │ └── math │ │ ├── analysis │ │ ├── Fresnel.kt │ │ └── function │ │ │ ├── bivariate │ │ │ ├── BivariateFunction.kt │ │ │ ├── combination │ │ │ │ └── SectionedBivariateFunction.kt │ │ │ └── pure │ │ │ │ ├── PlaneFunction.kt │ │ │ │ └── ShapeFunction.kt │ │ │ └── univariate │ │ │ ├── UnivariateFunction.kt │ │ │ ├── combination │ │ │ ├── ConcatenatedFunction.kt │ │ │ ├── SectionedUnivariateFunction.kt │ │ │ └── StackedFunction.kt │ │ │ └── pure │ │ │ ├── ConstantFunction.kt │ │ │ ├── LinearFunction.kt │ │ │ └── PolynomialFunction.kt │ │ ├── container │ │ └── ConcatenationContainer.kt │ │ ├── geometry │ │ ├── GeometryException.kt │ │ ├── curved │ │ │ ├── oned │ │ │ │ └── point │ │ │ │ │ └── CurveRelativeVector1D.kt │ │ │ ├── threed │ │ │ │ ├── CurveRelativeAbstractGeometry3D.kt │ │ │ │ ├── curve │ │ │ │ │ └── CurveRelativeLineSegment3D.kt │ │ │ │ ├── point │ │ │ │ │ └── CurveRelativeVector3D.kt │ │ │ │ └── surface │ │ │ │ │ ├── AbstractCurveRelativeSurface3D.kt │ │ │ │ │ ├── CurveRelativeParametricSurface3D.kt │ │ │ │ │ └── SectionedCurveRelativeParametricSurface3D.kt │ │ │ └── twod │ │ │ │ └── point │ │ │ │ └── CurveRelativeVector2D.kt │ │ └── euclidean │ │ │ ├── AbstractGeometry.kt │ │ │ ├── threed │ │ │ ├── AbstractGeometry3D.kt │ │ │ ├── Geometry3DVisitor.kt │ │ │ ├── Pose3D.kt │ │ │ ├── Rotation3D.kt │ │ │ ├── curve │ │ │ │ ├── AbstractCurve3D.kt │ │ │ │ ├── CompositeCurve3D.kt │ │ │ │ ├── Curve3D.kt │ │ │ │ ├── CurveOnParametricSurface3D.kt │ │ │ │ ├── Line3D.kt │ │ │ │ ├── LineSegment3D.kt │ │ │ │ └── LineString3D.kt │ │ │ ├── point │ │ │ │ ├── AbstractPoint3D.kt │ │ │ │ └── Vector3D.kt │ │ │ ├── solid │ │ │ │ ├── AbstractSolid3D.kt │ │ │ │ ├── Cuboid3D.kt │ │ │ │ ├── Cylinder3D.kt │ │ │ │ ├── ParametricSweep3D.kt │ │ │ │ └── Polyhedron3D.kt │ │ │ └── surface │ │ │ │ ├── AbstractSurface3D.kt │ │ │ │ ├── Circle3D.kt │ │ │ │ ├── CompositeSurface3D.kt │ │ │ │ ├── LinearRing3D.kt │ │ │ │ ├── ParametricBoundedSurface3D.kt │ │ │ │ ├── Plane3D.kt │ │ │ │ ├── Polygon3D.kt │ │ │ │ └── Rectangle3D.kt │ │ │ └── twod │ │ │ ├── AbstractGeometry2D.kt │ │ │ ├── Pose2D.kt │ │ │ ├── Rotation2D.kt │ │ │ ├── curve │ │ │ ├── AbstractCurve2D.kt │ │ │ ├── Arc2D.kt │ │ │ ├── CompositeCurve2D.kt │ │ │ ├── CubicCurve2D.kt │ │ │ ├── LateralTranslatedCurve2D.kt │ │ │ ├── LineSegment2D.kt │ │ │ ├── ParameterTransformedCurve2D.kt │ │ │ ├── ParametricCubicCurve2D.kt │ │ │ ├── SectionedCurve2D.kt │ │ │ ├── Spiral2D.kt │ │ │ └── SpiralSegment2D.kt │ │ │ ├── point │ │ │ ├── AbstractPoint2D.kt │ │ │ └── Vector2D.kt │ │ │ └── surface │ │ │ ├── AbstractSurface2D.kt │ │ │ └── Polygon2D.kt │ │ ├── linear │ │ ├── RealMatrix.kt │ │ ├── RealMatrixExtensions.kt │ │ ├── RealVector.kt │ │ ├── RealVectorExtensions.kt │ │ └── SingularValueDecomposition.kt │ │ ├── processing │ │ ├── Vector2DListExtensions.kt │ │ ├── Vector3DListExtensions.kt │ │ └── triangulation │ │ │ ├── FanTriangulationAlgorithm.kt │ │ │ ├── Poly2TriTriangulationAlgorithm.kt │ │ │ ├── ProjectedTriangulationAlgorithm.kt │ │ │ ├── TriangulationAlgorithm.kt │ │ │ ├── Triangulator.kt │ │ │ └── TriangulatorException.kt │ │ ├── projection │ │ ├── CoordinateReferenceSystem.kt │ │ └── CoordinateReferenceSystemException.kt │ │ ├── range │ │ ├── BoundType.kt │ │ ├── DefinableDomain.kt │ │ ├── DoubleRangeExtensions.kt │ │ ├── DoubleRangeSetExtensions.kt │ │ ├── IntRangeExtensions.kt │ │ ├── Range.kt │ │ ├── RangeExtensions.kt │ │ ├── RangeSet.kt │ │ ├── RangeSetExtensions.kt │ │ └── Tolerable.kt │ │ ├── std │ │ ├── DoubleArrayExtensions.kt │ │ ├── DoubleMathConstants.kt │ │ ├── DoubleMathExtensions.kt │ │ ├── IntegerMathExtensions.kt │ │ ├── PositiveDouble.kt │ │ ├── StrictlyPositiveDouble.kt │ │ └── ZeroOneDouble.kt │ │ └── transform │ │ ├── AbstractAffine.kt │ │ ├── Affine2D.kt │ │ ├── Affine3D.kt │ │ ├── AffineSequence2D.kt │ │ └── AffineSequence3D.kt │ └── test │ ├── cpp │ └── spiral │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── compile_run.sh │ │ └── src │ │ ├── fresnel_integral_sampler_main.c │ │ ├── odrSpiral │ │ ├── main.c │ │ ├── odrSpiral.c │ │ ├── odrSpiral.h │ │ └── readme.txt │ │ └── spiral_sampler_main.c │ └── kotlin │ └── io │ └── rtron │ └── math │ ├── SpiralSegment2DWriterTest.kt │ ├── analysis │ ├── FresnelTest.kt │ └── function │ │ ├── LinearFunctionTest.kt │ │ ├── bivariate │ │ └── SectionedBivariateFunctionTest.kt │ │ └── univariate │ │ └── combination │ │ └── ConcatenatedFunctionTest.kt │ ├── geometry │ └── euclidean │ │ ├── threed │ │ ├── Rotation3DTest.kt │ │ ├── Vector3DTest.kt │ │ ├── curve │ │ │ ├── Curve3DTest.kt │ │ │ ├── Line3DTest.kt │ │ │ ├── LineSegment3DTest.kt │ │ │ └── LineString3DTest.kt │ │ ├── point │ │ │ └── Pose3DTest.kt │ │ ├── solid │ │ │ ├── Cuboid3DTest.kt │ │ │ └── Cylinder3DTest.kt │ │ └── surface │ │ │ ├── LinearRing3DUtilTest.kt │ │ │ └── Polygon3DTest.kt │ │ └── twod │ │ ├── Pose2DTest.kt │ │ ├── Rotation2DTest.kt │ │ ├── curve │ │ ├── Arc2DTest.kt │ │ ├── CompositeCurve2DTest.kt │ │ ├── CubicCurve2DTest.kt │ │ ├── LineSegment2DTest.kt │ │ ├── ParametricCubicCurve2DTest.kt │ │ ├── Spiral2DTest.kt │ │ └── SpiralSegment2DTest.kt │ │ ├── point │ │ └── Vector2DTest.kt │ │ └── surface │ │ └── Polygon2DTest.kt │ ├── linear │ ├── MatrixUtilsTest.kt │ ├── RealMatrixTest.kt │ ├── RealVectorUtilsTest.kt │ └── SingularValueDecompositionTest.kt │ ├── processing │ ├── Plane3DUtilTest.kt │ ├── Vector2DListExtensionsTest.kt │ └── Vector3DListExtensionsTest.kt │ ├── projection │ └── CoordinateReferenceSystemTest.kt │ ├── range │ ├── DoubleRangeExtensionsTest.kt │ ├── DoubleRangeSetExtensionsTest.kt │ ├── RangeSetTest.kt │ └── RangeTest.kt │ ├── std │ └── DoubleArrayExtensionTest.kt │ └── transform │ ├── Affine2DTest.kt │ └── Affine3DTest.kt ├── rtron-model ├── README.md ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── io │ └── rtron │ └── model │ ├── AbstractModel.kt │ ├── citygml │ ├── CitygmlModel.kt │ └── code │ │ ├── AuxiliaryTrafficAreaFunctionCode.kt │ │ └── TrafficArea.kt │ ├── opendrive │ ├── OpendriveModel.kt │ ├── additions │ │ ├── extensions │ │ │ └── IdentifierUpdater.kt │ │ ├── identifier │ │ │ ├── AbstractOpendriveIdentifier.kt.kt │ │ │ ├── JunctionConnectionIdentifier.kt │ │ │ ├── JunctionIdentifier.kt │ │ │ ├── LaneIdentifier.kt │ │ │ ├── LaneRoadMarkIdentifier.kt │ │ │ ├── LaneSectionIdentifier.kt │ │ │ ├── RoadIdentifier.kt │ │ │ ├── RoadObjectIdentifier.kt │ │ │ ├── RoadObjectOutlineIdentifier.kt │ │ │ ├── RoadObjectRepeatIdentifier.kt │ │ │ └── RoadSignalIdentifier.kt │ │ └── optics │ │ │ └── Optics.kt │ ├── core │ │ ├── AdditionalData.kt │ │ ├── DataQuality.kt │ │ ├── DataQualityError.kt │ │ ├── DataQualityRawData.kt │ │ ├── Enumerations.kt │ │ ├── Header.kt │ │ ├── HeaderGeoReference.kt │ │ ├── HeaderOffset.kt │ │ ├── Include.kt │ │ ├── OpendriveElement.kt │ │ └── UserData.kt │ ├── junction │ │ ├── Enumerations.kt │ │ ├── Junction.kt │ │ ├── JunctionConnection.kt │ │ ├── JunctionConnectionLaneLink.kt │ │ ├── JunctionController.kt │ │ ├── JunctionPredecessorSuccessor.kt │ │ ├── JunctionPriority.kt │ │ ├── JunctionSurface.kt │ │ └── JunctionSurfaceCrg.kt │ ├── lane │ │ ├── Enumerations.kt │ │ ├── RoadLanes.kt │ │ ├── RoadLanesLaneOffset.kt │ │ ├── RoadLanesLaneSection.kt │ │ ├── RoadLanesLaneSectionCenter.kt │ │ ├── RoadLanesLaneSectionCenterLane.kt │ │ ├── RoadLanesLaneSectionLCRLaneLink.kt │ │ ├── RoadLanesLaneSectionLCRLaneLinkPredecessorSuccessor.kt │ │ ├── RoadLanesLaneSectionLCRLaneRoadMark.kt │ │ ├── RoadLanesLaneSectionLCRLaneRoadMarkExplicit.kt │ │ ├── RoadLanesLaneSectionLCRLaneRoadMarkExplicitLine.kt │ │ ├── RoadLanesLaneSectionLCRLaneRoadMarkSway.kt │ │ ├── RoadLanesLaneSectionLCRLaneRoadMarkType.kt │ │ ├── RoadLanesLaneSectionLCRLaneRoadMarkTypeLine.kt │ │ ├── RoadLanesLaneSectionLRLane.kt │ │ ├── RoadLanesLaneSectionLRLaneAccess.kt │ │ ├── RoadLanesLaneSectionLRLaneAccessRestriction.kt │ │ ├── RoadLanesLaneSectionLRLaneBorder.kt │ │ ├── RoadLanesLaneSectionLRLaneHeight.kt │ │ ├── RoadLanesLaneSectionLRLaneMaterial.kt │ │ ├── RoadLanesLaneSectionLRLaneRule.kt │ │ ├── RoadLanesLaneSectionLRLaneSpeed.kt │ │ ├── RoadLanesLaneSectionLRLaneWidth.kt │ │ ├── RoadLanesLaneSectionLeft.kt │ │ ├── RoadLanesLaneSectionLeftLane.kt │ │ ├── RoadLanesLaneSectionRight.kt │ │ └── RoadLanesLaneSectionRightLane.kt │ ├── objects │ │ ├── Enumerations.kt │ │ ├── RoadObjects.kt │ │ ├── RoadObjectsBridge.kt │ │ ├── RoadObjectsObject.kt │ │ ├── RoadObjectsObjectBorders.kt │ │ ├── RoadObjectsObjectBordersBorder.kt │ │ ├── RoadObjectsObjectLaneValidity.kt │ │ ├── RoadObjectsObjectMarkings.kt │ │ ├── RoadObjectsObjectMarkingsMarking.kt │ │ ├── RoadObjectsObjectMarkingsMarkingCornerReference.kt │ │ ├── RoadObjectsObjectMaterial.kt │ │ ├── RoadObjectsObjectOutlines.kt │ │ ├── RoadObjectsObjectOutlinesOutline.kt │ │ ├── RoadObjectsObjectOutlinesOutlineCornerLocal.kt │ │ ├── RoadObjectsObjectOutlinesOutlineCornerRoad.kt │ │ ├── RoadObjectsObjectParkingSpace.kt │ │ ├── RoadObjectsObjectReference.kt │ │ ├── RoadObjectsObjectRepeat.kt │ │ ├── RoadObjectsObjectSurface.kt │ │ ├── RoadObjectsObjectSurfaceCrg.kt │ │ └── RoadObjectsTunnel.kt │ ├── railroad │ │ └── RoadRailroad.kt │ ├── road │ │ ├── Enumerations.kt │ │ ├── Road.kt │ │ ├── RoadLink.kt │ │ ├── RoadLinkPredecessorSuccessor.kt │ │ ├── RoadSurface.kt │ │ ├── RoadSurfaceCrg.kt │ │ ├── RoadType.kt │ │ ├── RoadTypeSpeed.kt │ │ ├── elevation │ │ │ ├── RoadElevationProfile.kt │ │ │ └── RoadElevationProfileElevation.kt │ │ ├── lateral │ │ │ ├── RoadLateralProfile.kt │ │ │ ├── RoadLateralProfileShape.kt │ │ │ └── RoadLateralProfileSuperelevation.kt │ │ └── planview │ │ │ ├── RoadPlanView.kt │ │ │ ├── RoadPlanViewGeometry.kt │ │ │ ├── RoadPlanViewGeometryArc.kt │ │ │ ├── RoadPlanViewGeometryLine.kt │ │ │ ├── RoadPlanViewGeometryParamPoly3.kt │ │ │ ├── RoadPlanViewGeometryPoly3.kt │ │ │ └── RoadPlanViewGeometrySpiral.kt │ └── signal │ │ ├── Controller.kt │ │ ├── ControllerControl.kt │ │ ├── ERoadSignalsSignalReferenceElementType.kt │ │ ├── RoadSignals.kt │ │ ├── RoadSignalsSignal.kt │ │ ├── RoadSignalsSignalDependency.kt │ │ ├── RoadSignalsSignalPositionInertial.kt │ │ ├── RoadSignalsSignalPositionRoad.kt │ │ └── RoadSignalsSignalReference.kt │ └── roadspaces │ ├── Header.kt │ ├── RoadspacesModel.kt │ ├── common │ ├── LateralFillerSurface.kt │ └── LongitudinalFillerSurface.kt │ ├── identifier │ ├── AbstractRoadspacesIdentifier.kt │ ├── ConnectionIdentifier.kt │ ├── JunctionIdentifier.kt │ ├── LaneIdentifier.kt │ ├── LaneSectionIdentifier.kt │ ├── LateralLaneRangeIdentifier.kt │ ├── LongitudinalLaneRangeIdentifier.kt │ ├── RoadSide.kt │ ├── RoadspaceIdentifier.kt │ └── RoadspaceObjectIdentifier.kt │ ├── junction │ ├── Connection.kt │ └── Junction.kt │ └── roadspace │ ├── Roadspace.kt │ ├── RoadspaceContactPointIdentifier.kt │ ├── attribute │ ├── AttributeDSL.kt │ ├── Attributes.kt │ └── UnitOfMeasure.kt │ ├── objects │ ├── RoadObjectSubType.kt │ ├── RoadObjectType.kt │ └── RoadspaceObject.kt │ └── road │ ├── Lane.kt │ ├── LaneChange.kt │ ├── LaneMaterial.kt │ ├── LaneSection.kt │ ├── LaneType.kt │ ├── Road.kt │ ├── RoadLinkage.kt │ └── RoadMarking.kt ├── rtron-readerwriter ├── README.md ├── build.gradle.kts └── src │ └── main │ ├── kotlin │ └── io │ │ └── rtron │ │ └── readerwriter │ │ ├── citygml │ │ ├── CitygmlVersion.kt │ │ └── CitygmlWriter.kt │ │ └── opendrive │ │ ├── OpendriveReader.kt │ │ ├── OpendriveValidator.kt │ │ ├── OpendriveWriter.kt │ │ ├── reader │ │ ├── OpendriveUnmarshaller.kt │ │ ├── mapper │ │ │ ├── common │ │ │ │ └── OpendriveCommonMapper.kt │ │ │ ├── opendrive14 │ │ │ │ ├── Opendrive14CoreMapper.kt │ │ │ │ ├── Opendrive14JunctionMapper.kt │ │ │ │ ├── Opendrive14LaneMapper.kt │ │ │ │ ├── Opendrive14Mapper.kt │ │ │ │ ├── Opendrive14ObjectMapper.kt │ │ │ │ ├── Opendrive14RoadMapper.kt │ │ │ │ └── Opendrive14SignalMapper.kt │ │ │ ├── opendrive16 │ │ │ │ ├── Opendrive16CoreMapper.kt │ │ │ │ ├── Opendrive16JunctionMapper.kt │ │ │ │ ├── Opendrive16LaneMapper.kt │ │ │ │ ├── Opendrive16Mapper.kt │ │ │ │ ├── Opendrive16ObjectMapper.kt │ │ │ │ ├── Opendrive16RoadMapper.kt │ │ │ │ └── Opendrive16SignalMapper.kt │ │ │ ├── opendrive17 │ │ │ │ └── Opendrive17Mapper.kt │ │ │ └── opendrive18 │ │ │ │ ├── Opendrive18CoreMapper.kt │ │ │ │ ├── Opendrive18JunctionMapper.kt │ │ │ │ ├── Opendrive18LaneMapper.kt │ │ │ │ ├── Opendrive18Mapper.kt │ │ │ │ ├── Opendrive18ObjectMapper.kt │ │ │ │ ├── Opendrive18RoadMapper.kt │ │ │ │ └── Opendrive18SignalMapper.kt │ │ └── validation │ │ │ └── OpendriveValidationEventHandler.kt │ │ ├── report │ │ ├── ReportExtensions.kt │ │ ├── SchemaValidationIssue.kt │ │ └── SchemaValidationReport.kt │ │ ├── version │ │ ├── OpendriveVersion.kt │ │ └── OpendriveVersionUtils.kt │ │ └── writer │ │ ├── OpendriveMarshaller.kt │ │ └── mapper │ │ ├── common │ │ └── OpendriveCommonMapper.kt │ │ └── opendrive17 │ │ ├── Opendrive17CoreMapper.kt │ │ ├── Opendrive17JunctionMapper.kt │ │ ├── Opendrive17LaneMapper.kt │ │ ├── Opendrive17Mapper.kt │ │ ├── Opendrive17ObjectMapper.kt │ │ ├── Opendrive17RoadMapper.kt │ │ └── Opendrive17SignalMapper.kt │ └── resources │ └── schemas │ ├── opendrive11.xjb │ ├── opendrive11 │ └── OpenDRIVE_1.1D.xsd │ ├── opendrive12.xjb │ ├── opendrive12 │ └── OpenDRIVE_1.2A.xsd │ ├── opendrive13.xjb │ ├── opendrive13 │ └── OpenDRIVE_1.3D.xsd │ ├── opendrive14.xjb │ ├── opendrive14 │ └── OpenDRIVE_1.4H.xsd │ ├── opendrive15.xjb │ ├── opendrive15 │ └── OpenDRIVE_1.5M.xsd │ ├── opendrive16.xjb │ ├── opendrive16 │ ├── opendrive_16_core.xsd │ ├── opendrive_16_junction.xsd │ ├── opendrive_16_lane.xsd │ ├── opendrive_16_object.xsd │ ├── opendrive_16_railroad.xsd │ ├── opendrive_16_road.xsd │ └── opendrive_16_signal.xsd │ ├── opendrive17.xjb │ ├── opendrive17 │ ├── opendrive_17_core.xsd │ ├── opendrive_17_junction.xsd │ ├── opendrive_17_lane.xsd │ ├── opendrive_17_object.xsd │ ├── opendrive_17_railroad.xsd │ ├── opendrive_17_road.xsd │ └── opendrive_17_signal.xsd │ ├── opendrive18-original │ ├── OpenDRIVE_Core.xsd │ ├── OpenDRIVE_Junction.xsd │ ├── OpenDRIVE_Lane.xsd │ ├── OpenDRIVE_Object.xsd │ ├── OpenDRIVE_Railroad.xsd │ ├── OpenDRIVE_Road.xsd │ └── OpenDRIVE_Signal.xsd │ ├── opendrive18.xjb │ └── opendrive18 │ ├── OpenDRIVE_Core.xsd │ ├── OpenDRIVE_Junction.xsd │ ├── OpenDRIVE_Lane.xsd │ ├── OpenDRIVE_Object.xsd │ ├── OpenDRIVE_Railroad.xsd │ ├── OpenDRIVE_Road.xsd │ └── OpenDRIVE_Signal.xsd ├── rtron-std ├── README.md ├── build.gradle.kts └── src │ ├── main │ └── kotlin │ │ └── io │ │ └── rtron │ │ └── std │ │ ├── BaseException.kt │ │ ├── Collections.kt │ │ ├── Either.kt │ │ ├── Int.kt │ │ ├── Iterable.kt │ │ ├── Lists.kt │ │ ├── Option.kt │ │ ├── Property.kt │ │ ├── Sequences.kt │ │ ├── Sets.kt │ │ └── date │ │ └── DateTime.kt │ └── test │ └── kotlin │ └── io │ └── rtron │ └── std │ ├── CollectionsKtTest.kt │ ├── IterableKtTest.kt │ ├── ListsKtTest.kt │ ├── SequencesKtTest.kt │ └── SetsKtTest.kt ├── rtron-transformer ├── README.md ├── build.gradle.kts └── src │ ├── main │ └── kotlin │ │ └── io │ │ └── rtron │ │ └── transformer │ │ ├── converter │ │ ├── opendrive2roadspaces │ │ │ ├── Opendrive2RoadspacesParameters.kt │ │ │ ├── Opendrive2RoadspacesTransformer.kt │ │ │ ├── analysis │ │ │ │ └── FunctionBuilder.kt │ │ │ ├── geometry │ │ │ │ ├── Curve2DBuilder.kt │ │ │ │ ├── Curve3DBuilder.kt │ │ │ │ ├── GeometryBuilderException.kt │ │ │ │ ├── LinearRing3DFactory.kt │ │ │ │ ├── Polyhedron3DFactory.kt │ │ │ │ ├── Solid3DBuilder.kt │ │ │ │ ├── Surface3DBuilder.kt │ │ │ │ └── Vector3DBuilder.kt │ │ │ ├── header │ │ │ │ └── HeaderBuilder.kt │ │ │ ├── junction │ │ │ │ └── JunctionBuilder.kt │ │ │ ├── report │ │ │ │ └── Opendrive2RoadspacesReport.kt │ │ │ └── roadspaces │ │ │ │ ├── Attributes.kt │ │ │ │ ├── LaneBuilder.kt │ │ │ │ ├── RoadBuilder.kt │ │ │ │ ├── RoadspaceBuilder.kt │ │ │ │ └── RoadspaceObjectBuilder.kt │ │ └── roadspaces2citygml │ │ │ ├── Roadspaces2CitygmlParameters.kt │ │ │ ├── Roadspaces2CitygmlTransformer.kt │ │ │ ├── geometry │ │ │ ├── AbstractOccupiedSpaceExtensions.kt │ │ │ ├── AbstractSpaceExtensions.kt │ │ │ ├── AbstractThematicSurfaceExtensions.kt │ │ │ ├── GeometryTransformer.kt │ │ │ ├── GeometryTransformerException.kt │ │ │ └── MathTransformer.kt │ │ │ ├── module │ │ │ ├── AttributesAdder.kt │ │ │ ├── BuildingModuleBuilder.kt │ │ │ ├── CityFurnitureModuleBuilder.kt │ │ │ ├── CodeAdder.kt │ │ │ ├── GenericsModuleBuilder.kt │ │ │ ├── IdentifierAdder.kt │ │ │ ├── RelationAdder.kt │ │ │ ├── TransportationModuleBuilder.kt │ │ │ └── VegetationModuleBuilder.kt │ │ │ ├── report │ │ │ └── Roadspaces2CitygmlReport.kt │ │ │ ├── router │ │ │ ├── LaneRouter.kt │ │ │ └── RoadspaceObjectRouter.kt │ │ │ └── transformer │ │ │ ├── IdentifierTransformer.kt │ │ │ ├── RoadsTransformer.kt │ │ │ └── RoadspaceObjectTransformer.kt │ │ ├── evaluator │ │ ├── opendrive │ │ │ ├── OpendriveEvaluator.kt │ │ │ ├── OpendriveEvaluatorParameters.kt │ │ │ ├── modifiers │ │ │ │ ├── BasicDataTypeModifier.kt │ │ │ │ └── JunctionModifier.kt │ │ │ ├── plans │ │ │ │ ├── AbstractOpendriveEvaluator.kt │ │ │ │ ├── basicdatatype │ │ │ │ │ ├── BasicDataTypeEvaluator.kt │ │ │ │ │ ├── CoreEvaluator.kt │ │ │ │ │ ├── JunctionEvaluator.kt │ │ │ │ │ ├── RoadEvaluator.kt │ │ │ │ │ ├── RoadLanesEvaluator.kt │ │ │ │ │ ├── RoadObjectsEvaluator.kt │ │ │ │ │ └── RoadSignalsEvaluator.kt │ │ │ │ ├── conversionrequirements │ │ │ │ │ ├── ConversionRequirementsEvaluator.kt │ │ │ │ │ └── JunctionEvaluator.kt │ │ │ │ └── modelingrules │ │ │ │ │ ├── JunctionEvaluator.kt │ │ │ │ │ ├── ModelingRulesEvaluator.kt │ │ │ │ │ ├── RoadEvaluator.kt │ │ │ │ │ ├── RoadLanesEvaluator.kt │ │ │ │ │ ├── RoadObjectsEvaluator.kt │ │ │ │ │ └── RoadSignalsEvaluator.kt │ │ │ └── report │ │ │ │ └── OpendriveEvaluationReport.kt │ │ └── roadspaces │ │ │ ├── RoadspacesEvaluator.kt │ │ │ ├── RoadspacesEvaluatorParameters.kt │ │ │ ├── plans │ │ │ ├── AbstractRoadspacesEvaluator.kt │ │ │ └── modelingrules │ │ │ │ └── ModelingRulesEvaluator.kt │ │ │ └── report │ │ │ └── RoadspacesEvaluationReport.kt │ │ ├── issues │ │ ├── opendrive │ │ │ └── DefaultIssueExtensions.kt │ │ └── roadspaces │ │ │ └── DefaultIssueExtensions.kt │ │ └── modifiers │ │ └── opendrive │ │ ├── cropper │ │ ├── OpendriveCropper.kt │ │ ├── OpendriveCropperParameters.kt │ │ └── OpendriveCropperReport.kt │ │ ├── offset │ │ ├── adder │ │ │ ├── OpendriveOffsetAdder.kt │ │ │ ├── OpendriveOffsetAdderParameters.kt │ │ │ └── OpendriveOffsetAdderReport.kt │ │ └── resolver │ │ │ ├── OpendriveOffsetResolver.kt │ │ │ └── OpendriveOffsetResolverReport.kt │ │ ├── remover │ │ ├── OpendriveObjectRemover.kt │ │ ├── OpendriveObjectRemoverParameters.kt │ │ └── OpendriveObjectRemoverReport.kt │ │ └── reprojector │ │ ├── OpendriveReprojector.kt │ │ ├── OpendriveReprojectorParameters.kt │ │ └── OpendriveReprojectorReport.kt │ └── test │ └── kotlin │ └── io │ └── rtron │ └── transformer │ └── modifiers │ └── opendrive │ └── reprojector │ └── OpendriveReprojectorTest.kt ├── samples ├── datasets-output │ └── .gitignore └── datasets │ ├── README.md │ ├── basic_sample_01.xodr │ └── basic_sample_02.xodr └── settings.gradle.kts /.dockerignore: -------------------------------------------------------------------------------- 1 | ### Java template 2 | # Compiled class file 3 | *.class 4 | 5 | # Log file 6 | *.log 7 | 8 | # BlueJ files 9 | *.ctxt 10 | 11 | # Mobile Tools for Java (J2ME) 12 | .mtj.tmp/ 13 | 14 | # Package Files # 15 | *.jar 16 | *.war 17 | *.nar 18 | *.ear 19 | *.zip 20 | *.tar.gz 21 | *.rar 22 | 23 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 24 | hs_err_pid* 25 | replay_pid* 26 | 27 | ### Gradle template 28 | .gradle 29 | **/build/ 30 | !src/**/build/ 31 | 32 | # Ignore Gradle GUI config 33 | gradle-app.setting 34 | 35 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 36 | !gradle-wrapper.jar 37 | 38 | # Avoid ignore Gradle wrappper properties 39 | !gradle-wrapper.properties 40 | 41 | # Cache of project 42 | .gradletasknamecache 43 | 44 | # Eclipse Gradle plugin generated files 45 | # Eclipse Core 46 | .project 47 | # JDT-specific (Eclipse Java Development Tools) 48 | .classpath 49 | 50 | ### Kotlin template 51 | # Compiled class file 52 | *.class 53 | 54 | # Log file 55 | *.log 56 | 57 | # BlueJ files 58 | *.ctxt 59 | 60 | # Mobile Tools for Java (J2ME) 61 | .mtj.tmp/ 62 | 63 | # Package Files # 64 | *.jar 65 | *.war 66 | *.nar 67 | *.ear 68 | *.zip 69 | *.tar.gz 70 | *.rar 71 | 72 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 73 | hs_err_pid* 74 | replay_pid* 75 | 76 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # These are explicitly windows files and should use crlf 5 | *.bat text eol=crlf 6 | 7 | -------------------------------------------------------------------------------- /.github/dependabot.yml.bak: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "gradle" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | -------------------------------------------------------------------------------- /.github/workflows/build-api-docs.yml: -------------------------------------------------------------------------------- 1 | name: Build API Docs 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | 10 | build: 11 | name: Build API Docs 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v4 16 | with: 17 | fetch-depth: 0 18 | - name: Set up JDK 17 19 | uses: actions/setup-java@v4 20 | with: 21 | java-version: 17 22 | distribution: 'temurin' 23 | - name: Run dokka build 24 | run: ./gradlew dokkaHtmlMultiModule --no-daemon --stacktrace 25 | - name: Deploy to netlify 26 | uses: netlify/actions/cli@master 27 | env: 28 | NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} 29 | NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} 30 | with: 31 | args: deploy --dir=build/dokka/htmlMultiModule --prod 32 | -------------------------------------------------------------------------------- /.github/workflows/validate-gradle-wrapper.yml: -------------------------------------------------------------------------------- 1 | name: Validate Gradle Wrapper 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | validation: 6 | name: "Validation" 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout 10 | uses: actions/checkout@v4 11 | with: 12 | fetch-depth: 0 13 | - uses: gradle/actions/wrapper-validation@v4 14 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.2 2 | authors: 3 | - family-names: "Schwab" 4 | given-names: "Benedikt" 5 | orcid: "https://orcid.org/0000-0002-4618-2538" 6 | - family-names: "Beil" 7 | given-names: "Christof" 8 | orcid: "https://orcid.org/0000-0002-6231-2769" 9 | - family-names: "Kolbe" 10 | given-names: "Thomas H." 11 | orcid: "https://orcid.org/0000-0003-1456-0423" 12 | title: "r:trån" 13 | date-released: 2020-06-02 14 | url: "https://github.com/tum-gis/rtron" 15 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:jdk17 AS builder 2 | 3 | LABEL maintainer="Benedikt Schwab" 4 | LABEL maintainer.email="benedikt.schwab(at)tum.de" 5 | LABEL maintainer.organization="Chair of Geoinformatics, Technical University of Munich (TUM)" 6 | LABEL source.repo="https://github.com/tum-gis/rtron" 7 | 8 | COPY . /home/app 9 | WORKDIR /home/app 10 | 11 | RUN gradle shadowJar 12 | 13 | 14 | FROM bellsoft/liberica-openjdk-debian:17 AS runtime 15 | 16 | WORKDIR /app 17 | COPY --from=builder /home/app/rtron-cli/build/libs/rtron-1*.jar /app/app.jar 18 | 19 | ENTRYPOINT ["java", "-jar", "/app/app.jar"] 20 | -------------------------------------------------------------------------------- /buildSrc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `kotlin-dsl` 3 | } 4 | 5 | repositories { 6 | mavenCentral() 7 | } 8 | -------------------------------------------------------------------------------- /buildSrc/settings.gradle.kts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tum-gis/rtron/2c743930fdf080de781945708b197f7f89019fb5/buildSrc/settings.gradle.kts -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/BuildProperties.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | object BuildPropertyNames { 18 | const val skipSigning = "skip.signing" 19 | } 20 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/Configuration.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | object Project { 18 | const val name = "rtron" 19 | const val group = "io.rtron" 20 | const val version = "1.3.0" 21 | } 22 | 23 | object ProjectComponents { 24 | // user interface layer 25 | const val main = ":rtron-main" 26 | 27 | // model transformation layer 28 | const val model = ":rtron-model" 29 | const val readerWriter = ":rtron-readerwriter" 30 | const val transformer = ":rtron-transformer" 31 | 32 | // utility layer 33 | const val math = ":rtron-math" 34 | const val standard = ":rtron-std" 35 | const val inputOutput = ":rtron-io" 36 | } 37 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/Plugins.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | object PluginVersions { 19 | const val shadowjar = "8.1.1" 20 | const val ktlint = "12.2.0" 21 | const val xjc = "1.6" 22 | const val versionChecker = "0.52.0" 23 | const val dokka = "2.0.0" 24 | const val serialization = "2.1.20" 25 | const val ksp = "2.1.20-1.0.32" 26 | } 27 | 28 | object Plugins { 29 | const val shadowjar = "com.github.johnrengelman.shadow" 30 | const val ktlint = "org.jlleitschuh.gradle.ktlint" 31 | const val xjc = "com.github.edeandrea.xjc-generation" 32 | const val versionChecker = "com.github.ben-manes.versions" 33 | const val dokka = "org.jetbrains.dokka" 34 | const val serialization = "plugin.serialization" 35 | const val ksp = "com.google.devtools.ksp" 36 | } 37 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/Repositories.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | object MavenSources { 19 | const val jitpack = "https://jitpack.io" 20 | const val sonatypeSnapshot = "https://oss.sonatype.org/content/repositories/snapshots/" 21 | } 22 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/Utils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import org.gradle.api.Project 18 | 19 | import org.gradle.kotlin.dsl.* 20 | 21 | /** 22 | * Configures the current project as a Kotlin project by adding the Kotlin `stdlib` as a dependency. 23 | */ 24 | fun Project.kotlinProject() { 25 | dependencies { 26 | "implementation"(kotlin(Dependencies.kotlinStandardLibrary)) 27 | } 28 | } 29 | 30 | fun isNonStable(version: String): Boolean { 31 | val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) } 32 | val regex = """^[0-9,.v-]+(-r)?$""".toRegex() 33 | return !stableKeyword && !(regex.containsMatchIn(version)) 34 | } 35 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | ## gradle.properties 2 | org.gradle.jvmargs=-XX:MaxMetaspaceSize=2G 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tum-gis/rtron/2c743930fdf080de781945708b197f7f89019fb5/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /jitpack.yml: -------------------------------------------------------------------------------- 1 | jdk: 2 | - openjdk17 3 | install: 4 | - ./gradlew build publishToMavenLocal -Pskip.signing 5 | -------------------------------------------------------------------------------- /rtron-cli/README.md: -------------------------------------------------------------------------------- 1 | # CLI Component 2 | 3 | This component handles the command line interfacing (CLI) and argument parsing. 4 | -------------------------------------------------------------------------------- /rtron-cli/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar 2 | 3 | plugins { 4 | application 5 | kotlin("jvm") 6 | id(Plugins.shadowjar) version PluginVersions.shadowjar 7 | kotlin(Plugins.serialization) version PluginVersions.serialization 8 | } 9 | 10 | kotlinProject() 11 | 12 | dependencies { 13 | // utility layer 14 | implementation(project(ProjectComponents.standard)) 15 | implementation(project(ProjectComponents.inputOutput)) 16 | 17 | // single model processing layer 18 | implementation(project(ProjectComponents.readerWriter)) 19 | implementation(project(ProjectComponents.transformer)) 20 | implementation(project(ProjectComponents.model)) 21 | 22 | // batch processing layer 23 | implementation(project(ProjectComponents.main)) 24 | 25 | // object creation libraries 26 | implementation(Dependencies.kotlinxSerializationJson) 27 | implementation(Dependencies.kaml) 28 | 29 | // io 30 | implementation(Dependencies.clikt) 31 | implementation(Dependencies.mordant) 32 | implementation(Dependencies.commonsLang) 33 | } 34 | 35 | application { 36 | mainClass.set("io.rtron.cli.Main") 37 | } 38 | 39 | tasks { 40 | named("shadowJar") { 41 | mergeServiceFiles() 42 | archiveFileName.set("${Project.name}.${this.archiveExtension.get()}") 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /rtron-cli/src/main/kotlin/io/rtron/cli/Main.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | @file:JvmName("Main") 18 | 19 | package io.rtron.cli 20 | 21 | import com.github.ajalt.clikt.core.CliktCommand 22 | import com.github.ajalt.clikt.core.main 23 | import com.github.ajalt.clikt.core.subcommands 24 | import com.github.ajalt.clikt.parameters.options.versionOption 25 | 26 | class MainCommand : CliktCommand(name = "rtron") { 27 | override fun run() = Unit 28 | } 29 | 30 | /** 31 | * Entry point for command line interface. 32 | * 33 | * @param args arguments of the cli 34 | */ 35 | fun main(args: Array) = 36 | MainCommand() 37 | .versionOption("1.3.1") 38 | .subcommands(SubcommandValidateOpendrive(), SubcommandOpendriveToCitygml()) 39 | .main(args) 40 | -------------------------------------------------------------------------------- /rtron-io/README.md: -------------------------------------------------------------------------------- 1 | # IO Component 2 | 3 | This component at the utility layer handles input-output functionalities that are close to the operating system. 4 | This includes the loading of scripts, representation of files and logging tasks. 5 | -------------------------------------------------------------------------------- /rtron-io/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | kotlin("jvm") 3 | kotlin(Plugins.serialization) version PluginVersions.serialization 4 | } 5 | 6 | kotlinProject() 7 | 8 | dependencies { 9 | // user interface layer components 10 | implementation(project(ProjectComponents.standard)) 11 | 12 | // object creation libraries 13 | implementation(Dependencies.kotlinxSerializationJson) 14 | 15 | // logging libraries 16 | implementation(Dependencies.kotlinLogging) 17 | implementation(Dependencies.slf4jSimple) 18 | 19 | // io libraries 20 | implementation(Dependencies.commonsIO) 21 | implementation(Dependencies.commonsCSV) 22 | implementation(Dependencies.commonsLang) 23 | implementation(Dependencies.commonsCompress) 24 | implementation(Dependencies.zstdJni) 25 | implementation(Dependencies.emojiJava) 26 | 27 | // math libraries 28 | implementation(Dependencies.guava) 29 | } 30 | -------------------------------------------------------------------------------- /rtron-io/src/main/kotlin/io/rtron/io/files/CompressedFileExtension.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.io.files 18 | 19 | /** 20 | * File extension representation of supported compression formats. 21 | */ 22 | enum class CompressedFileExtension(val extension: String, val extensionWithDot: String) { 23 | ZIP("zip", ".zip"), 24 | GZ("gz", ".gz"), 25 | ZST("zst", ".zst"), 26 | } 27 | -------------------------------------------------------------------------------- /rtron-io/src/main/kotlin/io/rtron/io/files/FileExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.io.files 18 | 19 | import java.io.File 20 | import com.google.common.hash.Hashing as GHashing 21 | import com.google.common.io.Files as GFiles 22 | 23 | /** 24 | * SHA256 hash of the file or directory. 25 | */ 26 | fun File.getHashSha256() = 27 | try { 28 | GFiles.asByteSource(this).hash(GHashing.sha256()).toString() 29 | } catch (e: Exception) { 30 | "" 31 | } 32 | -------------------------------------------------------------------------------- /rtron-io/src/main/kotlin/io/rtron/io/issues/DefaultIssue.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.io.issues 18 | 19 | import kotlinx.serialization.Serializable 20 | 21 | /** 22 | * Single issue. 23 | */ 24 | @Serializable 25 | data class DefaultIssue( 26 | val type: String, 27 | val info: String, 28 | val location: String, 29 | val incidentSeverity: Severity, 30 | val wasFixed: Boolean, 31 | val infoValues: Map = emptyMap(), 32 | ) { 33 | // Properties and Initializers 34 | val issueSeverity: Severity = 35 | when (Pair(incidentSeverity, wasFixed)) { 36 | Pair(Severity.FATAL_ERROR, true) -> Severity.ERROR 37 | Pair(Severity.ERROR, true) -> Severity.WARNING 38 | else -> incidentSeverity 39 | } 40 | 41 | companion object 42 | } 43 | -------------------------------------------------------------------------------- /rtron-io/src/main/kotlin/io/rtron/io/issues/Severity.kt: -------------------------------------------------------------------------------- 1 | package io.rtron.io.issues 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | @Serializable 6 | enum class Severity { 7 | WARNING, 8 | ERROR, 9 | FATAL_ERROR, 10 | } 11 | -------------------------------------------------------------------------------- /rtron-main/README.md: -------------------------------------------------------------------------------- 1 | # Main Component 2 | 3 | This component provides the infrastructure DSL for writing and running the transformation scripts. 4 | -------------------------------------------------------------------------------- /rtron-main/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | kotlin("jvm") 3 | kotlin(Plugins.serialization) version PluginVersions.serialization 4 | } 5 | 6 | kotlinProject() 7 | 8 | dependencies { 9 | // utility layer components 10 | implementation(project(ProjectComponents.standard)) 11 | implementation(project(ProjectComponents.inputOutput)) 12 | 13 | // single model processing layer components 14 | implementation(project(ProjectComponents.model)) 15 | implementation(project(ProjectComponents.readerWriter)) 16 | implementation(project(ProjectComponents.transformer)) 17 | 18 | // object creation libraries 19 | implementation(Dependencies.kotlinxSerializationJson) 20 | implementation(Dependencies.kaml) 21 | 22 | // logging libraries 23 | implementation(Dependencies.kotlinLogging) 24 | implementation(Dependencies.slf4jSimple) 25 | } 26 | -------------------------------------------------------------------------------- /rtron-main/src/main/kotlin/io/rtron/main/processor/CompressionFormat.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.main.processor 18 | 19 | enum class CompressionFormat { 20 | NONE, 21 | GZ, 22 | ZIP, 23 | ZST, 24 | } 25 | 26 | fun CompressionFormat.toFileExtension(): String = 27 | when (this) { 28 | CompressionFormat.NONE -> "" 29 | CompressionFormat.GZ -> ".gz" 30 | CompressionFormat.ZIP -> ".zip" 31 | CompressionFormat.ZST -> ".zst" 32 | } 33 | -------------------------------------------------------------------------------- /rtron-main/src/main/kotlin/io/rtron/main/project/Project.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.main.project 18 | 19 | import java.nio.file.Path 20 | import kotlin.io.path.createDirectories 21 | 22 | data class Project( 23 | val inputFilePath: Path, 24 | val outputDirectoryPath: Path, 25 | ) { 26 | // Properties and Initializers 27 | init { 28 | outputDirectoryPath.createDirectories() 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /rtron-math/README.md: -------------------------------------------------------------------------------- 1 | # Math Component 2 | 3 | This component at the utility layer contains all math functionality, such as geometries with [B-rep](https://en.wikipedia.org/wiki/Boundary_representation) 4 | generations, affine transformation matrices as well as triangulation algorithms. 5 | -------------------------------------------------------------------------------- /rtron-math/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | kotlin("jvm") 3 | } 4 | 5 | kotlinProject() 6 | 7 | dependencies { 8 | // utility layer components 9 | implementation(project(ProjectComponents.standard)) 10 | testImplementation(project(ProjectComponents.inputOutput)) 11 | 12 | // math libraries 13 | implementation(Dependencies.guava) 14 | implementation(Dependencies.commonsMath) 15 | implementation(Dependencies.joml) 16 | 17 | // geo libraries 18 | implementation(Dependencies.proj4) 19 | implementation(Dependencies.proj4Epsg) 20 | implementation(Dependencies.poly2tri) 21 | 22 | // testing 23 | testImplementation(Dependencies.commonsCSV) 24 | testImplementation(Dependencies.kotlinLogging) 25 | } 26 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/geometry/curved/threed/CurveRelativeAbstractGeometry3D.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.geometry.curved.threed 18 | 19 | /** 20 | * Abstract class for all curve relative geometric objects in 3D. 21 | */ 22 | abstract class CurveRelativeAbstractGeometry3D 23 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/geometry/euclidean/AbstractGeometry.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.geometry.euclidean 18 | 19 | /** 20 | * Abstract class for all geometric objects. 21 | */ 22 | abstract class AbstractGeometry 23 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/geometry/euclidean/threed/AbstractGeometry3D.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.geometry.euclidean.threed 18 | 19 | import io.rtron.math.geometry.euclidean.AbstractGeometry 20 | import io.rtron.math.transform.AffineSequence3D 21 | 22 | /** 23 | * Abstract class for all geometric objects in 3D. 24 | */ 25 | abstract class AbstractGeometry3D : AbstractGeometry() { 26 | /** 27 | * List of affine transformation matrices to move and rotate the geometric object. 28 | */ 29 | open val affineSequence: AffineSequence3D = AffineSequence3D.EMPTY 30 | 31 | /** 32 | * Accepting function so that a geometry visitor can pass by. 33 | */ 34 | abstract fun accept(visitor: Geometry3DVisitor) 35 | } 36 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/geometry/euclidean/threed/point/AbstractPoint3D.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.geometry.euclidean.threed.point 18 | 19 | import io.rtron.math.geometry.euclidean.threed.AbstractGeometry3D 20 | 21 | /** 22 | * Abstract class for all geometric point objects in 3D. 23 | */ 24 | abstract class AbstractPoint3D : AbstractGeometry3D() { 25 | /** 26 | * Returns the point in the local coordinate system. 27 | */ 28 | abstract fun calculatePointLocalCS(): Vector3D 29 | 30 | /** 31 | * Returns the point in the global coordinate system. 32 | */ 33 | fun calculatePointGlobalCS(): Vector3D = affineSequence.solve().transform(calculatePointLocalCS()) 34 | } 35 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/geometry/euclidean/twod/AbstractGeometry2D.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.geometry.euclidean.twod 18 | 19 | import io.rtron.math.geometry.euclidean.AbstractGeometry 20 | import io.rtron.math.transform.AffineSequence2D 21 | 22 | /** 23 | * Abstract class for all geometric objects in 2D. 24 | */ 25 | abstract class AbstractGeometry2D : AbstractGeometry() { 26 | /** 27 | * List of affine transformation matrices to move and rotate the geometric object. 28 | */ 29 | open val affineSequence: AffineSequence2D = AffineSequence2D.EMPTY 30 | } 31 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/geometry/euclidean/twod/point/AbstractPoint2D.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.geometry.euclidean.twod.point 18 | 19 | import io.rtron.math.geometry.euclidean.twod.AbstractGeometry2D 20 | 21 | /** 22 | * Abstract class for all geometric point objects in 2D. 23 | */ 24 | abstract class AbstractPoint2D : AbstractGeometry2D() 25 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/geometry/euclidean/twod/surface/AbstractSurface2D.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.geometry.euclidean.twod.surface 18 | 19 | import io.rtron.math.geometry.euclidean.twod.AbstractGeometry2D 20 | import io.rtron.math.geometry.euclidean.twod.point.Vector2D 21 | import io.rtron.math.range.Tolerable 22 | 23 | /** 24 | * Abstract class for all geometric surface objects in 2D. 25 | */ 26 | abstract class AbstractSurface2D : AbstractGeometry2D(), Tolerable { 27 | /** 28 | * Returns true, if [point] is located within the surface. 29 | */ 30 | abstract fun contains(point: Vector2D): Boolean 31 | } 32 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/linear/RealVectorExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.linear 18 | 19 | /** 20 | * Returns the dimension of the linear span of a given list of [RealVector]. 21 | * See the wikipedia article on [linear span](https://en.wikipedia.org/wiki/Linear_span). 22 | * 23 | * @receiver list of vectors for which the dimension of the span is to be evaluated 24 | * @return dimension of the span 25 | */ 26 | fun List.dimensionOfSpan(): Int { 27 | if (this.isEmpty()) return 0 28 | val singularValueDecomposition = SingularValueDecomposition(RealMatrix(this)) 29 | return singularValueDecomposition.rank 30 | } 31 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/processing/Vector2DListExtensions.kt: -------------------------------------------------------------------------------- 1 | package io.rtron.math.processing 2 | 3 | import io.rtron.math.geometry.euclidean.twod.point.Vector2D 4 | import io.rtron.std.zipWithNextEnclosing 5 | 6 | /** 7 | * Returns true, if the list of [Vector2D] has a clockwise order. 8 | * 9 | * @see [StackOverflow Answer](https://stackoverflow.com/a/1165943) 10 | */ 11 | fun List.isClockwiseOrdered(): Boolean { 12 | require(this.distinct().size >= 3) { "At least three distinct vectors must be provided." } 13 | return zipWithNextEnclosing().sumOf { (it.second.x - it.first.x) * (it.second.y + it.first.y) } > 0.0 14 | } 15 | 16 | /** 17 | * Returns true, if the list of [Vector2D] has an anti-clockwise order. 18 | */ 19 | fun List.isCounterClockwiseOrdered(): Boolean = !this.isClockwiseOrdered() 20 | 21 | /** 22 | * Calculates the centroid of a list of [Vector2D]. 23 | * See the wikipedia article of [Centroid](https://en.wikipedia.org/wiki/Centroid). 24 | */ 25 | fun List.calculateCentroid(): Vector2D = this.reduce { sum, point -> sum + point }.div(this.size.toDouble()) 26 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/processing/triangulation/TriangulatorException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.processing.triangulation 18 | 19 | sealed class TriangulatorException(val message: String) { 20 | data class Poly2TriException(val reason: String) : TriangulatorException("Poly2Tri-Triangulation failure: $reason") 21 | 22 | data class DifferentVertices(val suffix: String = "") : TriangulatorException("Triangulation algorithm produced different vertices.") 23 | 24 | data class ColinearVertices(val suffix: String = "") : TriangulatorException("Triangulation failure (colinear vertices).") 25 | 26 | data class FirstVertexDuplicated(val suffix: String = "") : TriangulatorException("First vertex has duplicate vertices.") 27 | } 28 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/projection/CoordinateReferenceSystemException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.projection 18 | 19 | sealed class CoordinateReferenceSystemException(val message: String) { 20 | data class UnkownEpsgCode(val reason: String) : CoordinateReferenceSystemException("Unkown EPSG code: ") 21 | } 22 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/range/DefinableDomain.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.range 18 | 19 | /** 20 | * Classes which have definable domain. 21 | * See wikipedia article on [domain of a function](https://en.wikipedia.org/wiki/Domain_of_a_function). 22 | */ 23 | interface DefinableDomain> { 24 | /** definable [domain] */ 25 | val domain: Range 26 | } 27 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/range/DoubleRangeSetExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.range 18 | 19 | fun RangeSet.Companion.ofNonIntersectingRanges(ranges: Set>): RangeSet { 20 | val rangeSets = ranges.map { of(it) }.toSet() 21 | require(!rangeSets.containsIntersectingRangeSets()) { "Creation of RangeSet must not contain connected ranges." } 22 | return rangeSets.unionRangeSets() 23 | } 24 | 25 | fun RangeSet.Companion.ofNonIntersectingRanges(vararg ranges: Range): RangeSet = ofNonIntersectingRanges(ranges.toSet()) 26 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/range/IntRangeExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.range 18 | 19 | /** 20 | * Difference between the upper and lower bound of the [Range]. 21 | */ 22 | val Range.difference: Int 23 | get() { 24 | val adjustedLowerEndpoint = lowerEndpointOrNull() ?: Int.MIN_VALUE 25 | val adjustedUpperEndpoint = upperEndpointOrNull() ?: Int.MAX_VALUE 26 | return adjustedUpperEndpoint - adjustedLowerEndpoint 27 | } 28 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/range/RangeExtensions.kt: -------------------------------------------------------------------------------- 1 | package io.rtron.math.range 2 | 3 | /** 4 | * Returns the intersecting [Range] of a provided set of ranges. 5 | * 6 | * @receiver provided set of ranges for which the intersecting range shall be found 7 | * @return maximum range that intersects all ranges within the set 8 | */ 9 | fun > Set>.intersectingRange(): Range = reduce { acc, element -> acc.intersection(element) } 10 | 11 | /** 12 | * Union operation of a set of [Range] to a [RangeSet]. 13 | */ 14 | fun > Set>.unionRanges(): RangeSet = map { RangeSet.of(it) }.toSet().unionRangeSets() 15 | 16 | /** 17 | * Returns true, if the set of ranges contains intersecting [Range]. 18 | */ 19 | fun > Set>.containsIntersectingRanges(): Boolean { 20 | val rangeSetsList = this.map { RangeSet.of(it) } 21 | return rangeSetsList.toSet().containsIntersectingRangeSets() 22 | } 23 | 24 | /** 25 | * Returns true, if the list of ranges contains consecutively following ranges that intersect. 26 | */ 27 | fun > List>.containsConsecutivelyIntersectingRanges(): Boolean = 28 | map { it.toRangeSet() }.zipWithNext().any { it.first.intersects(it.second) } 29 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/range/RangeSetExtensions.kt: -------------------------------------------------------------------------------- 1 | package io.rtron.math.range 2 | 3 | import io.rtron.std.powerSet 4 | 5 | /** 6 | * Unions a set of [RangeSet] to a single [RangeSet]. 7 | */ 8 | fun > Set>.unionRangeSets(): RangeSet = reduce { acc, element -> acc.union(element) } 9 | 10 | /** 11 | * Returns the intersecting [RangeSet]. 12 | * 13 | * @receiver provided set of [RangeSet] for which the intersecting [RangeSet] is evaluated 14 | * @return minimum intersecting range set 15 | */ 16 | fun > Set>.intersectionRangeSets(): RangeSet = reduce { acc, element -> acc.intersection(element) } 17 | 18 | /** 19 | * Returns true, if set of [RangeSet] contains intersecting [RangeSet] pairs. 20 | */ 21 | fun > Set>.containsIntersectingRangeSets(): Boolean { 22 | val rangeSetPairCombinations = 23 | powerSet().filter { it.size == 2 }.map { Pair(it.first(), it.last()) } 24 | return rangeSetPairCombinations.any { it.first.intersects(it.second) } 25 | } 26 | 27 | /** 28 | * Conversion to [RangeSet]. 29 | * 30 | * @receiver [Range] to be converted 31 | */ 32 | fun > Range.toRangeSet(): RangeSet = RangeSet.of(this) 33 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/range/Tolerable.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.range 18 | 19 | /** 20 | * Classes which have a tolerance. 21 | */ 22 | interface Tolerable { 23 | /** tolerable threshold value */ 24 | val tolerance: Double 25 | } 26 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/std/IntegerMathExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.std 18 | 19 | /** 20 | * Returns the signum of an integer [x]. 21 | * 22 | * @param x the value whose sign is to be computed 23 | * @return -1, if [x] is negative; 0, if [x] is zero; +1, if [x] is positive 24 | */ 25 | fun sign(x: Int): Int = Integer.signum(x) 26 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/std/PositiveDouble.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.std 18 | 19 | /** 20 | * Double number with value greater equals zero. 21 | */ 22 | class PositiveDouble(val value: Double) { 23 | // Properties and Initializers 24 | init { 25 | require(0 <= value) { "Value must be positive (greater equals zero)." } 26 | } 27 | 28 | // Methods 29 | } 30 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/std/StrictlyPositiveDouble.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.std 18 | 19 | /** 20 | * Double number with value greater zero. 21 | */ 22 | class StrictlyPositiveDouble(val value: Double) { 23 | // Properties and Initializers 24 | init { 25 | require(0 < value) { "Value must be positive (greater zero)." } 26 | } 27 | 28 | // Methods 29 | } 30 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/std/ZeroOneDouble.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.std 18 | 19 | /** 20 | * Double number with values between zero and one inclusive. 21 | */ 22 | class ZeroOneDouble(val value: Double) { 23 | // Properties and Initializers 24 | init { 25 | require(0 <= value) { "Value must be greater equals zero." } 26 | require(value <= 1) { "Value must be lower equals one." } 27 | } 28 | 29 | // Methods 30 | } 31 | -------------------------------------------------------------------------------- /rtron-math/src/main/kotlin/io/rtron/math/transform/AbstractAffine.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.transform 18 | 19 | /** 20 | * Representation of an abstract affine transformation matrix. 21 | */ 22 | abstract class AbstractAffine 23 | -------------------------------------------------------------------------------- /rtron-math/src/test/cpp/spiral/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.1) 2 | 3 | project(OpendriveSpiralTest C) 4 | 5 | add_executable(fresnel_integral_sampler src/odrSpiral/odrSpiral.h src/odrSpiral/odrSpiral.c src/fresnel_integral_sampler_main.c) 6 | target_link_libraries(fresnel_integral_sampler m) 7 | 8 | add_executable(spiral_sampler src/odrSpiral/odrSpiral.h src/odrSpiral/odrSpiral.c src/spiral_sampler_main.c) 9 | target_link_libraries(spiral_sampler m) 10 | 11 | -------------------------------------------------------------------------------- /rtron-math/src/test/cpp/spiral/README.md: -------------------------------------------------------------------------------- 1 | # Spiral Test 2 | 3 | Small program for sampling the Fresnel integral and the spiral implementation 4 | used in [ASAM OpenDRIVE](https://www.asam.net/standards/detail/opendrive/). 5 | 6 | ## Prerequisites 7 | 8 | Install the build tools: 9 | 10 | ```bash 11 | sudo apt-get install cmake build-essential 12 | ``` 13 | 14 | ## Building 15 | 16 | Build the programs using CMake: 17 | 18 | ```bash 19 | mkdir -p build && cd build 20 | cmake .. 21 | make 22 | ``` 23 | 24 | ## Running 25 | 26 | Run both executables: 27 | 28 | ```bash 29 | ./fresnel_integral_sampler 30 | ./spiral_sampler 31 | ``` 32 | 33 | Or, compile and run it via the script: 34 | 35 | ```bash 36 | ./compile_run.sh 37 | ``` 38 | 39 | ## Acknowledgements 40 | 41 | Thanks to: 42 | - Stephen L. Moshier for the Fresnel integral implementation in the [CEPHES](http://www.netlib.org/cephes/) library 43 | - [ASAM](https://www.asam.net) for providing the odrSpiral implementation 44 | -------------------------------------------------------------------------------- /rtron-math/src/test/cpp/spiral/compile_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir -p build && cd build 4 | cmake .. 5 | make 6 | 7 | ./fresnel_integral_sampler 8 | ./spiral_sampler 9 | -------------------------------------------------------------------------------- /rtron-math/src/test/cpp/spiral/src/fresnel_integral_sampler_main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "odrSpiral/odrSpiral.h" 4 | 5 | int main(int argc, char *argv[]) { 6 | fprintf(stdout, "start fresnel_integral_sampler\n"); 7 | 8 | double l_min = -0.2 - 1.0/7; 9 | double l_max = 0.2 + 1.0/7; 10 | int l_steps = 200000; 11 | double l_step_size = (l_max-l_min) / l_steps; 12 | fprintf(stdout, "l parameters: min: %.5f, max: %.5f, steps: %i, step_size: %.5f\n", l_min, l_max, l_steps, l_step_size); 13 | 14 | double l_values[l_steps]; 15 | int i_l = 0; 16 | for (double l = l_min; l < l_max; l += l_step_size) { 17 | l_values[i_l] = l; 18 | i_l++; 19 | } 20 | // for selected values, use: 21 | // double l_values[] = {-4.228402886795016, 883.1267776797073, -1.8154077322757265}; 22 | 23 | 24 | double l, x, y; 25 | int count = 0; 26 | 27 | char filename[] = "sampled_fresnel_integral.csv"; 28 | fprintf(stdout, "start writing sampled points to %s\n", filename); 29 | FILE *fpt; 30 | fpt = fopen(filename, "w+"); 31 | fprintf( fpt, "l,x,y\n"); 32 | 33 | 34 | for (i_l = 0; i_l < sizeof(l_values)/sizeof(double); i_l++) 35 | { 36 | fresnel( l_values[i_l], &y, &x ); 37 | fprintf( fpt, "%.17g,%.17g,%.17g\n", l_values[i_l], x, y); 38 | count++; 39 | } 40 | fprintf(stdout, "wrote %i sample points\n", count); 41 | } 42 | -------------------------------------------------------------------------------- /rtron-math/src/test/cpp/spiral/src/odrSpiral/odrSpiral.h: -------------------------------------------------------------------------------- 1 | /* =================================================== 2 | * file: odrSpiral.c 3 | * --------------------------------------------------- 4 | * purpose: free sample for computing spirals 5 | * in OpenDRIVE applications 6 | * --------------------------------------------------- 7 | * first edit: 09.03.2010 by M. Dupuis @ VIRES GmbH 8 | * last mod.: 10.03.2020 by N. Dillmann @ ASAM e.V. 9 | * =================================================== 10 | * ASAM OpenDRIVE 1.6 Spiral example implementation 11 | * 12 | * 13 | * (C) by ASAM e.V., 2020 14 | * Any use is limited to the scope described in the license terms. 15 | * The license terms can be viewed at www.asam.net/license 16 | */ 17 | 18 | 19 | /** 20 | * compute the actual "standard" spiral, starting with curvature 0 21 | * @param s run-length along spiral 22 | * @param cDot first derivative of curvature [1/m2] 23 | * @param x resulting x-coordinate in spirals local co-ordinate system [m] 24 | * @param y resulting y-coordinate in spirals local co-ordinate system [m] 25 | * @param t tangent direction at s [rad] 26 | */ 27 | 28 | extern void odrSpiral( double s, double cDot, double *x, double *y, double *t ); 29 | 30 | /** 31 | * added to make this function accessible 32 | */ 33 | extern void fresnel( double xxa, double *ssa, double *cca ); 34 | -------------------------------------------------------------------------------- /rtron-math/src/test/kotlin/io/rtron/math/geometry/euclidean/threed/curve/Line3DTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.geometry.euclidean.threed.curve 18 | 19 | import io.kotest.assertions.throwables.shouldThrow 20 | import io.kotest.core.spec.style.FunSpec 21 | import io.rtron.math.geometry.euclidean.threed.point.Vector3D 22 | 23 | class Line3DTest : FunSpec({ 24 | context("Addition") { 25 | 26 | test("throws error if ") { 27 | val point = Vector3D(1.0, 1.0, 1.0) 28 | 29 | shouldThrow { 30 | Line3D(point, point, 0.0) 31 | } 32 | } 33 | } 34 | }) 35 | -------------------------------------------------------------------------------- /rtron-math/src/test/kotlin/io/rtron/math/geometry/euclidean/threed/solid/Cylinder3DTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.geometry.euclidean.threed.solid 18 | 19 | import io.kotest.core.spec.style.FunSpec 20 | import io.kotest.matchers.booleans.shouldBeTrue 21 | import io.rtron.math.std.DBL_EPSILON_1 22 | import io.rtron.math.transform.AffineSequence3D 23 | 24 | class Cylinder3DTest : FunSpec({ 25 | context("PolygonsGeneration") { 26 | 27 | test("polygons start at level zero") { 28 | val cylinder = Cylinder3D(0.5, 1.0, DBL_EPSILON_1, AffineSequence3D.EMPTY) 29 | 30 | val actualPolygons = cylinder.calculatePolygonsGlobalCS() 31 | 32 | actualPolygons.any { polygon -> polygon.vertices.any { it.z == 0.0 } }.shouldBeTrue() 33 | } 34 | } 35 | }) 36 | -------------------------------------------------------------------------------- /rtron-math/src/test/kotlin/io/rtron/math/linear/MatrixUtilsTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.math.linear 18 | 19 | import io.kotest.core.spec.style.FunSpec 20 | import io.kotest.matchers.shouldBe 21 | 22 | class MatrixUtilsTest : FunSpec({ 23 | context("TestAppendColumn") { 24 | 25 | test("append column with two elements") { 26 | val matrixValues = arrayOf(doubleArrayOf(1.0, 0.0), doubleArrayOf(0.0, 4.0)) 27 | val matrix = RealMatrix(matrixValues) 28 | val column = doubleArrayOf(2.0, 1.0) 29 | 30 | val actualAppendedMatrix = matrix.appendColumn(column) 31 | 32 | actualAppendedMatrix.getRow(0) shouldBe doubleArrayOf(1.0, 0.0, 2.0) 33 | actualAppendedMatrix.getRow(1) shouldBe doubleArrayOf(0.0, 4.0, 1.0) 34 | } 35 | } 36 | }) 37 | -------------------------------------------------------------------------------- /rtron-model/README.md: -------------------------------------------------------------------------------- 1 | # Model Component 2 | 3 | This component contains the implementations of the different models like OpenDRIVE, CityGML and the road spaces implementation. 4 | -------------------------------------------------------------------------------- /rtron-model/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | kotlin("jvm") 3 | id(Plugins.ksp) version PluginVersions.ksp 4 | idea 5 | } 6 | 7 | kotlinProject() 8 | 9 | dependencies { 10 | // utility layer components 11 | implementation(project(ProjectComponents.standard)) 12 | implementation(project(ProjectComponents.inputOutput)) 13 | implementation(project(ProjectComponents.math)) 14 | 15 | ksp(Dependencies.arrowOpticsKspPlugin) 16 | 17 | // geo libraries 18 | implementation(Dependencies.citygml4jXml) 19 | } 20 | 21 | tasks.named("sourcesJar") { 22 | dependsOn("kspKotlin") 23 | duplicatesStrategy = DuplicatesStrategy.INCLUDE 24 | } 25 | 26 | // see: https://kotlinlang.org/docs/ksp-quickstart.html#make-ide-aware-of-generated-code 27 | idea { 28 | module { 29 | // Not using += due to https://github.com/gradle/gradle/issues/8749 30 | sourceDirs = sourceDirs + file("build/generated/ksp/main/kotlin") // or tasks["kspKotlin"].destination 31 | testSourceDirs = testSourceDirs + file("build/generated/ksp/test/kotlin") 32 | generatedSourceDirs = generatedSourceDirs + file("build/generated/ksp/main/kotlin") + file("build/generated/ksp/test/kotlin") 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/AbstractModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model 18 | 19 | /** 20 | * Represents all models 21 | */ 22 | abstract class AbstractModel 23 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/citygml/CitygmlModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.citygml 18 | 19 | import arrow.core.Option 20 | import io.rtron.model.AbstractModel 21 | import org.citygml4j.core.model.core.AbstractCityObject 22 | import org.xmlobjects.gml.model.feature.BoundingShape 23 | 24 | /** 25 | * Implementation of the CityGML data model according to version 2.0. 26 | * See the [official page](https://www.ogc.org/standards/citygml) from the Open Geospatial Consortium (OGC) for more. 27 | * 28 | * @param name name of the model 29 | * @param boundingShape bounding shape containing coordinate reference system 30 | * @param cityObjects list of city objects 31 | */ 32 | class CitygmlModel( 33 | val name: Option, 34 | val boundingShape: BoundingShape, 35 | val cityObjects: List, 36 | ) : AbstractModel() 37 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/additions/identifier/AbstractOpendriveIdentifier.kt.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.additions.identifier 18 | 19 | import arrow.core.Option 20 | 21 | abstract class AbstractOpendriveIdentifier { 22 | abstract fun toIdentifierText(): String 23 | } 24 | 25 | fun Option.toIdentifierText() = this.fold({ "Unknown" }, { it.toIdentifierText() }) 26 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/additions/identifier/JunctionConnectionIdentifier.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.additions.identifier 18 | 19 | import arrow.core.Option 20 | 21 | interface JunctionConnectionIdentifierInterface { 22 | val connectionId: String 23 | } 24 | 25 | data class JunctionConnectionIdentifier(override val connectionId: String, val junctionIdentifier: JunctionIdentifier) : 26 | AbstractOpendriveIdentifier(), JunctionConnectionIdentifierInterface, JunctionIdentifierInterface by junctionIdentifier { 27 | // Conversions 28 | override fun toIdentifierText() = 29 | "Connection: connectionId=$connectionId, " + 30 | "junctionId=${junctionIdentifier.junctionId}" 31 | } 32 | 33 | interface AdditionalJunctionConnectionIdentifier { 34 | var additionalId: Option 35 | } 36 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/additions/identifier/JunctionIdentifier.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.additions.identifier 18 | 19 | import arrow.core.Option 20 | 21 | interface JunctionIdentifierInterface { 22 | val junctionId: String 23 | } 24 | 25 | data class JunctionIdentifier(override val junctionId: String) : AbstractOpendriveIdentifier(), JunctionIdentifierInterface { 26 | // Conversions 27 | override fun toIdentifierText() = "Junction: junctionId=$junctionId" 28 | } 29 | 30 | interface AdditionalJunctionIdentifier { 31 | var additionalId: Option 32 | } 33 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/additions/identifier/LaneIdentifier.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.additions.identifier 18 | 19 | import arrow.core.Option 20 | 21 | interface LaneIdentifierInterface { 22 | val laneId: Int 23 | } 24 | 25 | data class LaneIdentifier(override val laneId: Int, val laneSectionIdentifier: LaneSectionIdentifier) : 26 | AbstractOpendriveIdentifier(), LaneIdentifierInterface, RoadLaneSectionIdentifierInterface by laneSectionIdentifier { 27 | // Conversions 28 | override fun toIdentifierText() = 29 | "Lane: laneId=$laneId, " + 30 | "laneSectionIndex=${laneSectionIdentifier.laneSectionIndex}, " + 31 | "roadId=${laneSectionIdentifier.roadIdentifier.roadId}" 32 | } 33 | 34 | interface AdditionalLaneIdentifier { 35 | var additionalId: Option 36 | } 37 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/additions/identifier/LaneSectionIdentifier.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.additions.identifier 18 | 19 | import arrow.core.Option 20 | 21 | interface RoadLaneSectionIdentifierInterface { 22 | val laneSectionIndex: Int 23 | } 24 | 25 | data class LaneSectionIdentifier(override val laneSectionIndex: Int, val roadIdentifier: RoadIdentifier) : 26 | AbstractOpendriveIdentifier(), RoadLaneSectionIdentifierInterface, RoadIdentifierInterface by roadIdentifier { 27 | // Conversions 28 | override fun toIdentifierText() = "Lane section: laneSectionIndex=$laneSectionIndex, roadId=${roadIdentifier.roadId}" 29 | } 30 | 31 | interface AdditionalLaneSectionIdentifier { 32 | var additionalId: Option 33 | } 34 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/additions/identifier/RoadIdentifier.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.additions.identifier 18 | 19 | import arrow.core.Option 20 | 21 | interface RoadIdentifierInterface { 22 | val roadId: String 23 | } 24 | 25 | data class RoadIdentifier(override val roadId: String) : 26 | AbstractOpendriveIdentifier(), RoadIdentifierInterface { 27 | // Conversions 28 | override fun toIdentifierText() = "Road: roadId=$roadId" 29 | } 30 | 31 | interface AdditionalRoadIdentifier { 32 | var additionalId: Option 33 | } 34 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/additions/identifier/RoadObjectIdentifier.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.additions.identifier 18 | 19 | import arrow.core.Option 20 | 21 | interface RoadObjectIdentifierInterface { 22 | val roadObjectId: String 23 | } 24 | 25 | data class RoadObjectIdentifier(override val roadObjectId: String, val roadIdentifier: RoadIdentifier) : 26 | AbstractOpendriveIdentifier(), RoadObjectIdentifierInterface, RoadIdentifierInterface by roadIdentifier { 27 | // Conversions 28 | override fun toIdentifierText() = "Road object: roadObjectId=$roadObjectId, roadId=$roadId" 29 | } 30 | 31 | interface AdditionalRoadObjectIdentifier { 32 | var additionalId: Option 33 | } 34 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/additions/identifier/RoadSignalIdentifier.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.additions.identifier 18 | 19 | import arrow.core.Option 20 | 21 | interface RoadSignalIdentifierInterface { 22 | val roadSignalId: String 23 | } 24 | 25 | data class RoadSignalIdentifier(override val roadSignalId: String, val roadIdentifier: RoadIdentifier) : 26 | AbstractOpendriveIdentifier(), RoadSignalIdentifierInterface, RoadIdentifierInterface by roadIdentifier { 27 | // Conversions 28 | override fun toIdentifierText() = "Road signal: roadSignalId=$roadSignalId, roadId=${roadIdentifier.roadId}" 29 | } 30 | 31 | interface AdditionalRoadSignalIdentifier { 32 | var additionalId: Option 33 | } 34 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/core/AdditionalData.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.core 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | 22 | data class AdditionalData( 23 | var userData: List = emptyList(), 24 | var include: List = emptyList(), 25 | var dataQuality: Option = None, 26 | ) 27 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/core/DataQuality.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.core 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | 22 | data class DataQuality( 23 | var error: Option = None, 24 | var rawData: Option = None, 25 | ) 26 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/core/DataQualityError.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.core 18 | 19 | data class DataQualityError( 20 | var xyAbsolute: Double = Double.NaN, 21 | var xyRelative: Double = Double.NaN, 22 | var zAbsolute: Double = Double.NaN, 23 | var zRelative: Double = Double.NaN, 24 | ) 25 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/core/DataQualityRawData.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.core 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | 22 | data class DataQualityRawData( 23 | var date: String = "", 24 | var postProcessing: EDataQualityRawDataPostProcessing = EDataQualityRawDataPostProcessing.RAW, 25 | var postProcessingComment: Option = None, 26 | var source: EDataQualityRawDataSource = EDataQualityRawDataSource.CUSTOM, 27 | var sourceComment: Option = None, 28 | ) 29 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/core/Header.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.core 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import arrow.optics.optics 22 | 23 | @optics 24 | data class Header( 25 | var geoReference: Option = None, 26 | var offset: Option = None, 27 | var date: Option = None, 28 | var east: Option = None, 29 | var name: Option = None, 30 | var north: Option = None, 31 | var revMajor: Int = -1, 32 | var revMinor: Int = -1, 33 | var south: Option = None, 34 | var vendor: Option = None, 35 | var version: Option = None, 36 | var west: Option = None, 37 | ) : OpendriveElement() { 38 | companion object 39 | } 40 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/core/HeaderGeoReference.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.core 18 | 19 | data class HeaderGeoReference( 20 | var content: String, 21 | var g_additionalData: List = emptyList(), 22 | ) 23 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/core/HeaderOffset.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.core 18 | 19 | data class HeaderOffset( 20 | var hdg: Double = 0.0, 21 | var x: Double = 0.0, 22 | var y: Double = 0.0, 23 | var z: Double = 0.0, 24 | ) : OpendriveElement() 25 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/core/Include.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.core 18 | 19 | data class Include( 20 | var file: String = "", 21 | ) 22 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/core/OpendriveElement.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.core 18 | 19 | open class OpendriveElement( 20 | var g_AdditionalData: List = emptyList(), 21 | ) 22 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/core/UserData.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.core 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | 22 | data class UserData( 23 | // TODO: sequence 24 | var code: String = "", 25 | var value: Option = None, 26 | ) 27 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/junction/Enumerations.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.junction 18 | 19 | enum class EConnectionType { DEFAULT, VIRTUAL } 20 | 21 | enum class EContactPoint { START, END } 22 | 23 | enum class EElementDir { PLUS, MINUS } 24 | 25 | enum class EJunctionSurfaceCRGMode { GLOBAL } 26 | 27 | enum class EJunctionType { DEFAULT, VIRTUAL, DIRECT, CROSSING } 28 | 29 | enum class EJunctionGroupType { ROUNDABOUT, UNKNOWN } 30 | 31 | enum class ERoadSurfaceCrgMode { ATTACHED, ATTACHED0, GENUINE, GLOBAL } 32 | 33 | enum class ERoadSurfaceCrgPurpose { ELEVATION, FRICTION } 34 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/junction/JunctionConnectionLaneLink.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.junction 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class JunctionConnectionLaneLink( 22 | var from: Int = Int.MIN_VALUE, 23 | var to: Int = Int.MIN_VALUE, 24 | ) : OpendriveElement() 25 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/junction/JunctionController.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.junction 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class JunctionController( 24 | var id: String = "", 25 | var sequence: Option = None, 26 | var type: Option = None, 27 | ) : OpendriveElement() 28 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/junction/JunctionPredecessorSuccessor.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.junction 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class JunctionPredecessorSuccessor( 22 | var elementDir: EElementDir = EElementDir.PLUS, 23 | var elementId: String = "", 24 | var elementS: Double = Double.NaN, 25 | var elementType: String = "", 26 | ) : OpendriveElement() 27 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/junction/JunctionPriority.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.junction 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class JunctionPriority( 24 | var high: Option = None, 25 | var low: Option = None, 26 | ) : OpendriveElement() 27 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/junction/JunctionSurface.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.junction 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class JunctionSurface( 22 | var crg: List = emptyList(), 23 | ) : OpendriveElement() 24 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/junction/JunctionSurfaceCrg.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.junction 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class JunctionSurfaceCrg( 24 | var file: String = "", 25 | var mode: EJunctionSurfaceCRGMode = EJunctionSurfaceCRGMode.GLOBAL, 26 | var purpose: Option = None, 27 | var zOffset: Option = None, 28 | var zScale: Option = None, 29 | ) : OpendriveElement() 30 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneOffset.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLanesLaneOffset( 22 | var a: Double = Double.NaN, 23 | var b: Double = Double.NaN, 24 | var c: Double = Double.NaN, 25 | var d: Double = Double.NaN, 26 | var s: Double = Double.NaN, 27 | ) : OpendriveElement() { 28 | // Properties and Initializers 29 | val coefficients get() = doubleArrayOf(a, b, c, d) 30 | } 31 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionCenter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import arrow.optics.optics 20 | import io.rtron.model.opendrive.core.OpendriveElement 21 | 22 | @optics 23 | data class RoadLanesLaneSectionCenter( 24 | var lane: RoadLanesLaneSectionCenterLane = RoadLanesLaneSectionCenterLane(), 25 | ) : OpendriveElement() { 26 | // Methods 27 | fun getIndividualCenterLane(): RoadLanesLaneSectionCenterLane { 28 | return lane 29 | } 30 | 31 | fun getNumberOfLanes() = 1 // TODO remove 32 | 33 | companion object 34 | } 35 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLCRLaneLink.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLanesLaneSectionLCRLaneLink( 22 | var predecessor: List = emptyList(), 23 | var successor: List = emptyList(), 24 | ) : OpendriveElement() 25 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLCRLaneLinkPredecessorSuccessor.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLanesLaneSectionLCRLaneLinkPredecessorSuccessor( 22 | var id: Int = Int.MIN_VALUE, 23 | ) : OpendriveElement() 24 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLCRLaneRoadMarkExplicit.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLanesLaneSectionLCRLaneRoadMarkExplicit( 22 | var line: List = emptyList(), 23 | ) : OpendriveElement() 24 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLCRLaneRoadMarkExplicitLine.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadLanesLaneSectionLCRLaneRoadMarkExplicitLine( 24 | var length: Double = Double.NaN, 25 | var rule: Option = None, 26 | var sOffset: Double = Double.NaN, 27 | var tOffset: Double = Double.NaN, 28 | var width: Option = None, 29 | ) : OpendriveElement() 30 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLCRLaneRoadMarkSway.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLanesLaneSectionLCRLaneRoadMarkSway( 22 | var a: Double = Double.NaN, 23 | var b: Double = Double.NaN, 24 | var c: Double = Double.NaN, 25 | var d: Double = Double.NaN, 26 | var ds: Double = Double.NaN, 27 | ) : OpendriveElement() { 28 | // Properties and Initializers 29 | val coefficients get() = doubleArrayOf(a, b, c, d) 30 | } 31 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLCRLaneRoadMarkType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLanesLaneSectionLCRLaneRoadMarkType( 22 | var line: List = emptyList(), 23 | var name: String = "", 24 | var width: Double = Double.NaN, 25 | ) : OpendriveElement() 26 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLCRLaneRoadMarkTypeLine.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadLanesLaneSectionLCRLaneRoadMarkTypeLine( 24 | var color: Option = None, 25 | var length: Double = Double.NaN, 26 | var rule: Option = None, 27 | var sOffset: Double = Double.NaN, 28 | var space: Double = Double.NaN, 29 | var tOffset: Double = Double.NaN, 30 | var width: Option = None, 31 | ) : OpendriveElement() 32 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLRLaneAccess.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLanesLaneSectionLRLaneAccess( 22 | var restriction: List = emptyList(), 23 | var rule: ERoadLanesLaneSectionLRLaneAccessRule = ERoadLanesLaneSectionLRLaneAccessRule.ALLOW, 24 | var sOffset: Double = Double.NaN, 25 | ) : OpendriveElement() 26 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLRLaneAccessRestriction.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLanesLaneSectionLRLaneAccessRestriction( 22 | var type: EAccessRestrictionType = EAccessRestrictionType.NONE, 23 | ) : OpendriveElement() 24 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLRLaneBorder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLanesLaneSectionLRLaneBorder( 22 | var a: Double = Double.NaN, 23 | var b: Double = Double.NaN, 24 | var c: Double = Double.NaN, 25 | var d: Double = Double.NaN, 26 | var sOffset: Double = Double.NaN, 27 | ) : OpendriveElement() { 28 | // Properties and Initializers 29 | val coefficients get() = doubleArrayOf(a, b, c, d) 30 | } 31 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLRLaneHeight.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLanesLaneSectionLRLaneHeight( 22 | var inner: Double = Double.NaN, 23 | var outer: Double = Double.NaN, 24 | var sOffset: Double = Double.NaN, 25 | ) : OpendriveElement() 26 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLRLaneMaterial.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLanesLaneSectionLRLaneMaterial( 22 | var friction: Double = Double.NaN, 23 | var roughness: Double = Double.NaN, 24 | var sOffset: Double = Double.NaN, 25 | var surface: String = "", 26 | ) : OpendriveElement() 27 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLRLaneRule.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLanesLaneSectionLRLaneRule( 22 | var sOffset: Double = Double.NaN, 23 | var value: String = "", 24 | ) : OpendriveElement() 25 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLRLaneSpeed.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.EUnitSpeed 22 | import io.rtron.model.opendrive.core.OpendriveElement 23 | 24 | data class RoadLanesLaneSectionLRLaneSpeed( 25 | var max: Double = Double.NaN, 26 | var sOffset: Double = Double.NaN, 27 | var unit: Option = None, 28 | ) : OpendriveElement() 29 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionLeft.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import arrow.optics.optics 20 | import io.rtron.model.opendrive.core.OpendriveElement 21 | 22 | @optics 23 | data class RoadLanesLaneSectionLeft( 24 | var lane: List = emptyList(), 25 | ) : OpendriveElement() { 26 | // Methods 27 | fun isEmpty() = lane.isEmpty() 28 | 29 | fun isNotEmpty() = lane.isNotEmpty() 30 | 31 | fun getNumberOfLanes() = lane.size 32 | 33 | fun getLanes() = lane.associateBy { it.id } 34 | 35 | fun getLanesAscending() = lane.sortedBy { it.id } 36 | 37 | companion object 38 | } 39 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/lane/RoadLanesLaneSectionRight.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.lane 18 | 19 | import arrow.optics.optics 20 | import io.rtron.model.opendrive.core.OpendriveElement 21 | 22 | @optics 23 | data class RoadLanesLaneSectionRight( 24 | var lane: List = emptyList(), 25 | ) : OpendriveElement() { 26 | // Methods 27 | fun isEmpty() = lane.isEmpty() 28 | 29 | fun isNotEmpty() = lane.isNotEmpty() 30 | 31 | fun getNumberOfLanes() = lane.size 32 | 33 | fun getLanes() = lane.associateBy { it.id } 34 | 35 | fun getLanesDescending() = lane.sortedByDescending { it.id } 36 | 37 | companion object 38 | } 39 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/objects/RoadObjects.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.objects 18 | 19 | import arrow.optics.optics 20 | import io.rtron.model.opendrive.core.OpendriveElement 21 | 22 | @optics 23 | data class RoadObjects( 24 | var roadObject: List = emptyList(), 25 | var objectReference: List = emptyList(), 26 | var tunnel: List = emptyList(), 27 | var bridge: List = emptyList(), 28 | ) : OpendriveElement() { 29 | companion object 30 | } 31 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/objects/RoadObjectsBridge.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.objects 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadObjectsBridge( 24 | var validity: List = emptyList(), 25 | var id: String = "", 26 | var length: Double = Double.NaN, 27 | var name: Option = None, 28 | var s: Double = Double.NaN, 29 | var type: EBridgeType = EBridgeType.CONCRETE, 30 | ) : OpendriveElement() 31 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/objects/RoadObjectsObjectBorders.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.objects 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadObjectsObjectBorders( 22 | var marking: List = emptyList(), 23 | ) : OpendriveElement() 24 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/objects/RoadObjectsObjectBordersBorder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.objects 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadObjectsObjectBordersBorder( 24 | var cornerReference: List = emptyList(), 25 | var outlineId: Int = Int.MIN_VALUE, 26 | var type: EBorderType = EBorderType.CONCRETE, 27 | var useCompleteOutline: Option = None, 28 | var width: Double = Double.NaN, 29 | ) : OpendriveElement() 30 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/objects/RoadObjectsObjectLaneValidity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.objects 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadObjectsObjectLaneValidity( 22 | var fromLane: Int = Int.MIN_VALUE, 23 | var toLane: Int = Int.MIN_VALUE, 24 | ) : OpendriveElement() 25 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/objects/RoadObjectsObjectMarkings.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.objects 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadObjectsObjectMarkings( 22 | var marking: List = emptyList(), 23 | ) : OpendriveElement() 24 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/objects/RoadObjectsObjectMarkingsMarkingCornerReference.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.objects 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadObjectsObjectMarkingsMarkingCornerReference( 22 | var id: Int = Int.MIN_VALUE, 23 | ) : OpendriveElement() 24 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/objects/RoadObjectsObjectMaterial.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.objects 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadObjectsObjectMaterial( 24 | var friction: Option = None, 25 | var roughness: Option = None, 26 | var surface: Option = None, 27 | ) : OpendriveElement() 28 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/objects/RoadObjectsObjectParkingSpace.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.objects 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadObjectsObjectParkingSpace( 24 | var access: ERoadObjectsObjectParkingSpaceAccess = ERoadObjectsObjectParkingSpaceAccess.ALL, 25 | var restrictions: Option = None, 26 | ) : OpendriveElement() 27 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/objects/RoadObjectsObjectReference.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.objects 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadObjectsObjectReference( 24 | var validity: List = emptyList(), 25 | var id: String = "", 26 | var orientation: EOrientation = EOrientation.NONE, 27 | var s: Double = Double.NaN, 28 | var t: Double = Double.NaN, 29 | var validLength: Option = None, 30 | var zOffset: Option = None, 31 | ) : OpendriveElement() 32 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/objects/RoadObjectsObjectSurface.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.objects 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadObjectsObjectSurface( 24 | var crg: Option = None, 25 | ) : OpendriveElement() 26 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/objects/RoadObjectsObjectSurfaceCrg.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.objects 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadObjectsObjectSurfaceCrg( 24 | var file: Option = None, 25 | var hideRoadSurfaceCrg: Option = None, 26 | var zScale: Option = None, 27 | ) : OpendriveElement() 28 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/objects/RoadObjectsTunnel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.objects 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadObjectsTunnel( 24 | var validity: List = emptyList(), 25 | var daylight: Option = None, 26 | var id: String = "", 27 | var length: Double = Double.NaN, 28 | var lighting: Option = None, 29 | var name: Option = None, 30 | var s: Double = Double.NaN, 31 | var type: ETunnelType = ETunnelType.STANDARD, 32 | ) : OpendriveElement() 33 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/railroad/RoadRailroad.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.railroad 18 | 19 | data class RoadRailroad( 20 | // TODO 21 | var todo: String = "todo", 22 | ) 23 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/Enumerations.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road 18 | 19 | enum class EDirection { SAME, OPPOSITE } 20 | 21 | enum class EMaxSpeedString { NO_LIMIT, UNDEFINED } 22 | 23 | enum class ParamPoly3PRange { ARC_LENGTH, NORMALIZED } 24 | 25 | enum class ERoadLinkElementType { ROAD, JUNCTION } 26 | 27 | enum class ERoadType { 28 | UNKNOWN, 29 | RURAL, 30 | MOTORWAY, 31 | TOWN, 32 | LOW_SPEED, 33 | PEDESTRIAN, 34 | BICYCLE, 35 | TOWN_EXPRESSWAY, 36 | TOWN_COLLECTOR, 37 | TOWN_ARTERIAL, 38 | TOWN_PRIVATE, 39 | TOWN_LOCAL, 40 | TOWN_PLAY_STREET, 41 | } 42 | 43 | enum class ETrafficRule { RIGHT_HAND_TRAFFIC, LEFT_HAND_TRAFFIC } 44 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/RoadLink.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadLink( 24 | var predecessor: Option = None, 25 | var successor: Option = None, 26 | ) : OpendriveElement() { 27 | companion object 28 | } 29 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/RoadSurface.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadSurface( 22 | var crg: List = emptyList(), 23 | ) : OpendriveElement() 24 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/RoadType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.ECountryCode 22 | import io.rtron.model.opendrive.core.OpendriveElement 23 | 24 | data class RoadType( 25 | var speed: Option = None, 26 | var country: Option = None, 27 | var s: Double = Double.NaN, 28 | var type: ERoadType = ERoadType.UNKNOWN, 29 | ) : OpendriveElement() 30 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/RoadTypeSpeed.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.EUnitSpeed 22 | import io.rtron.model.opendrive.core.OpendriveElement 23 | 24 | data class RoadTypeSpeed( 25 | var max: Double = Double.NaN, 26 | var unit: Option = None, 27 | ) : OpendriveElement() 28 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/elevation/RoadElevationProfile.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road.elevation 18 | 19 | import arrow.core.NonEmptyList 20 | import arrow.core.toNonEmptyListOrNull 21 | import arrow.optics.optics 22 | import io.rtron.model.opendrive.core.OpendriveElement 23 | 24 | @optics 25 | data class RoadElevationProfile( 26 | var elevation: List = emptyList(), 27 | ) : OpendriveElement() { 28 | val elevationAsNonEmptyList: NonEmptyList 29 | get() = elevation.toNonEmptyListOrNull()!! 30 | 31 | companion object 32 | } 33 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/elevation/RoadElevationProfileElevation.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road.elevation 18 | 19 | import arrow.optics.optics 20 | import io.rtron.model.opendrive.core.OpendriveElement 21 | 22 | @optics 23 | data class RoadElevationProfileElevation( 24 | var a: Double = Double.NaN, 25 | var b: Double = Double.NaN, 26 | var c: Double = Double.NaN, 27 | var d: Double = Double.NaN, 28 | var s: Double = Double.NaN, 29 | ) : OpendriveElement() { 30 | // Properties and Initializers 31 | val coefficients get() = doubleArrayOf(a, b, c, d) 32 | 33 | // Methods 34 | 35 | companion object 36 | } 37 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/lateral/RoadLateralProfileShape.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road.lateral 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLateralProfileShape( 22 | var a: Double = Double.NaN, 23 | var b: Double = Double.NaN, 24 | var c: Double = Double.NaN, 25 | var d: Double = Double.NaN, 26 | var s: Double = Double.NaN, 27 | var t: Double = Double.NaN, 28 | ) : OpendriveElement() { 29 | // Properties and Initializers 30 | val coefficients get() = doubleArrayOf(a, b, c, d) 31 | } 32 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/lateral/RoadLateralProfileSuperelevation.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road.lateral 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadLateralProfileSuperelevation( 22 | var a: Double = Double.NaN, 23 | var b: Double = Double.NaN, 24 | var c: Double = Double.NaN, 25 | var d: Double = Double.NaN, 26 | var s: Double = Double.NaN, 27 | ) : OpendriveElement() { 28 | // Properties and Initializers 29 | val coefficients get() = doubleArrayOf(a, b, c, d) 30 | } 31 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/planview/RoadPlanView.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road.planview 18 | 19 | import arrow.core.NonEmptyList 20 | import arrow.core.toNonEmptyListOrNull 21 | import arrow.optics.optics 22 | import io.rtron.model.opendrive.core.OpendriveElement 23 | 24 | @optics 25 | data class RoadPlanView( 26 | var geometry: List = emptyList(), 27 | ) : OpendriveElement() { 28 | val geometryAsNonEmptyList: NonEmptyList 29 | get() = geometry.toNonEmptyListOrNull()!! 30 | 31 | companion object 32 | } 33 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/planview/RoadPlanViewGeometryArc.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road.planview 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadPlanViewGeometryArc( 22 | var curvature: Double = Double.NaN, 23 | ) : OpendriveElement() 24 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/planview/RoadPlanViewGeometryLine.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road.planview 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | class RoadPlanViewGeometryLine : OpendriveElement() 22 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/planview/RoadPlanViewGeometryPoly3.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road.planview 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadPlanViewGeometryPoly3( 22 | var a: Double = Double.NaN, 23 | var b: Double = Double.NaN, 24 | var c: Double = Double.NaN, 25 | var d: Double = Double.NaN, 26 | ) : OpendriveElement() { 27 | // Properties and Initializers 28 | val coefficients get() = doubleArrayOf(a, b, c, d) 29 | } 30 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/road/planview/RoadPlanViewGeometrySpiral.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.road.planview 18 | 19 | import io.rtron.model.opendrive.core.OpendriveElement 20 | 21 | data class RoadPlanViewGeometrySpiral( 22 | var curvEnd: Double = Double.NaN, 23 | var curvStart: Double = Double.NaN, 24 | ) : OpendriveElement() 25 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/signal/Controller.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.signal 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class Controller( 24 | var control: List = emptyList(), 25 | var id: String = "", 26 | var name: Option = None, 27 | var sequence: Option = None, 28 | ) : OpendriveElement() 29 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/signal/ControllerControl.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.signal 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class ControllerControl( 24 | var signalId: String = "", 25 | var type: Option = None, 26 | ) : OpendriveElement() 27 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/signal/ERoadSignalsSignalReferenceElementType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.signal 18 | 19 | enum class ERoadSignalsSignalReferenceElementType { 20 | OBJECT, 21 | SIGNAL, 22 | } 23 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/signal/RoadSignals.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.signal 18 | 19 | import arrow.optics.optics 20 | import io.rtron.model.opendrive.core.OpendriveElement 21 | 22 | @optics 23 | data class RoadSignals( 24 | var signal: List = emptyList(), 25 | var signalReference: List = emptyList(), 26 | ) : OpendriveElement() { 27 | companion object 28 | } 29 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/signal/RoadSignalsSignalDependency.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.signal 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadSignalsSignalDependency( 24 | var id: String = "", 25 | var type: Option = None, 26 | ) : OpendriveElement() 27 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/signal/RoadSignalsSignalPositionInertial.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.signal 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadSignalsSignalPositionInertial( 24 | var hdg: Double = Double.NaN, 25 | var pitch: Option = None, 26 | var roll: Option = None, 27 | var x: Double = Double.NaN, 28 | var y: Double = Double.NaN, 29 | var z: Double = Double.NaN, 30 | ) : OpendriveElement() 31 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/signal/RoadSignalsSignalPositionRoad.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.signal 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | data class RoadSignalsSignalPositionRoad( 24 | var hOffset: Double = Double.NaN, 25 | var pitch: Option = None, 26 | var roadId: String = "", 27 | var roll: Option = None, 28 | var s: Double = Double.NaN, 29 | var t: Double = Double.NaN, 30 | var zOffset: Double = Double.NaN, 31 | ) : OpendriveElement() 32 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/opendrive/signal/RoadSignalsSignalReference.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.opendrive.signal 18 | 19 | import arrow.core.None 20 | import arrow.core.Option 21 | import io.rtron.model.opendrive.core.OpendriveElement 22 | 23 | /** 24 | * Reference Record. 25 | */ 26 | data class RoadSignalsSignalReference( 27 | var elementId: String = "", 28 | var elementType: ERoadSignalsSignalReferenceElementType = ERoadSignalsSignalReferenceElementType.SIGNAL, 29 | var type: Option = None, 30 | var s: Double = Double.NaN, 31 | var t: Double = Double.NaN, 32 | ) : OpendriveElement() 33 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/roadspaces/Header.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.roadspaces 18 | 19 | import arrow.core.Option 20 | import io.rtron.math.projection.CoordinateReferenceSystem 21 | 22 | /** 23 | * Header of the [RoadspacesModel] containing the model's meta information. 24 | */ 25 | data class Header( 26 | val coordinateReferenceSystem: Option, 27 | val name: Option, 28 | val date: Option, 29 | val vendor: Option, 30 | val north: Double = Double.NaN, 31 | val south: Double = Double.NaN, 32 | val east: Double = Double.NaN, 33 | val west: Double = Double.NaN, 34 | ) 35 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/roadspaces/common/LateralFillerSurface.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.roadspaces.common 18 | 19 | import io.rtron.math.geometry.euclidean.threed.surface.AbstractSurface3D 20 | import io.rtron.math.range.difference 21 | import io.rtron.model.roadspaces.identifier.LateralLaneRangeIdentifier 22 | 23 | data class LateralFillerSurface(val id: LateralLaneRangeIdentifier, val surface: AbstractSurface3D) { 24 | // Properties and Initializers 25 | init { 26 | require(id.laneIdRange.difference == 1) { "Lane identifiers must be laterally adjacent." } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/roadspaces/identifier/AbstractRoadspacesIdentifier.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.roadspaces.identifier 18 | 19 | import arrow.core.Option 20 | import io.rtron.model.roadspaces.roadspace.attribute.AttributeList 21 | 22 | abstract class AbstractRoadspacesIdentifier { 23 | abstract fun toAttributes(prefix: String): AttributeList 24 | 25 | abstract fun toStringMap(): Map 26 | 27 | abstract fun toIdentifierText(): String 28 | } 29 | 30 | fun Option.toIdentifierText() = this.fold({ "Unknown" }, { it.toIdentifierText() }) 31 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/roadspaces/identifier/RoadSide.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.roadspaces.identifier 18 | 19 | enum class RoadSide { 20 | LEFT, 21 | CENTER, 22 | RIGHT, 23 | } 24 | 25 | fun RoadSide.opposite() = 26 | when (this) { 27 | RoadSide.LEFT -> RoadSide.RIGHT 28 | RoadSide.CENTER -> RoadSide.CENTER 29 | RoadSide.RIGHT -> RoadSide.LEFT 30 | } 31 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/roadspaces/roadspace/Roadspace.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.roadspaces.roadspace 18 | 19 | import io.rtron.math.geometry.euclidean.threed.curve.Curve3D 20 | import io.rtron.model.roadspaces.identifier.RoadspaceIdentifier 21 | import io.rtron.model.roadspaces.roadspace.attribute.AttributeList 22 | import io.rtron.model.roadspaces.roadspace.objects.RoadspaceObject 23 | import io.rtron.model.roadspaces.roadspace.road.Road 24 | 25 | /** 26 | * A [Roadspace] is defined along a [referenceLine] and contains the [roadspaceObjects] belonging to the road space. 27 | */ 28 | data class Roadspace( 29 | val id: RoadspaceIdentifier, 30 | val name: String, 31 | val referenceLine: Curve3D, 32 | val road: Road, 33 | val roadspaceObjects: List = emptyList(), 34 | val attributes: AttributeList = AttributeList(), 35 | ) 36 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/roadspaces/roadspace/attribute/UnitOfMeasure.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.roadspaces.roadspace.attribute 18 | 19 | enum class UnitOfMeasure { 20 | METER, 21 | KILOMETER, 22 | METER_PER_SECOND, 23 | MILES_PER_HOUR, 24 | KILOMETER_PER_HOUR, 25 | NONE, 26 | UNKNOWN, 27 | } 28 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/roadspaces/roadspace/objects/RoadObjectType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.roadspaces.roadspace.objects 18 | 19 | enum class RoadObjectType { 20 | NONE, 21 | OBSTACLE, 22 | POLE, 23 | TREE, 24 | VEGETATION, 25 | BARRIER, 26 | BUILDING, 27 | PARKING_SPACE, 28 | TRAFFIC_ISLAND, 29 | CROSSWALK, 30 | GANTRY, 31 | ROAD_MARK, 32 | ROAD_SURFACE, 33 | SIGNAL, 34 | } 35 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/roadspaces/roadspace/road/LaneChange.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.roadspaces.roadspace.road 18 | 19 | enum class LaneChange { 20 | BOTH, 21 | DECREASE, 22 | INCREASE, 23 | NONE, 24 | } 25 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/roadspaces/roadspace/road/LaneMaterial.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.roadspaces.roadspace.road 18 | 19 | data class LaneMaterial( 20 | var friction: Double = Double.NaN, 21 | var roughness: Double = Double.NaN, 22 | var surface: String = "", 23 | ) 24 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/roadspaces/roadspace/road/LaneType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.roadspaces.roadspace.road 18 | 19 | enum class LaneType { 20 | NONE, 21 | DRIVING, 22 | STOP, 23 | SHOULDER, 24 | BIKING, 25 | SHARED, 26 | SIDEWALK, 27 | BORDER, 28 | RESTRICTED, 29 | PARKING, 30 | CURB, 31 | BIDIRECTIONAL, 32 | MEDIAN, 33 | SPECIAL_1, 34 | SPECIAL_2, 35 | SPECIAL_3, 36 | ROAD_WORKS, 37 | TRAM, 38 | RAIL, 39 | ENTRY, 40 | EXIT, 41 | OFF_RAMP, 42 | ON_RAMP, 43 | CONNECTING_RAMP, 44 | BUS, 45 | TAXI, 46 | HOV, 47 | MWY_ENTRY, 48 | MWY_EXIT, 49 | WALKING, 50 | SLIP_LANE, 51 | } 52 | -------------------------------------------------------------------------------- /rtron-model/src/main/kotlin/io/rtron/model/roadspaces/roadspace/road/RoadMarking.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.model.roadspaces.roadspace.road 18 | 19 | import io.rtron.math.analysis.function.univariate.pure.ConstantFunction 20 | import io.rtron.model.roadspaces.roadspace.attribute.AttributeList 21 | 22 | /** 23 | * Represents a single road marking. 24 | * 25 | * @param width lateral width of the road marking 26 | * @param attributes further information attributes 27 | */ 28 | data class RoadMarking( 29 | val width: ConstantFunction, 30 | val laneChange: LaneChange, 31 | val attributes: AttributeList, 32 | ) { 33 | // Properties and Initializers 34 | init { 35 | require(width.domain.isNotEmpty()) { "The domain of the road marking's width must not be empty." } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /rtron-readerwriter/README.md: -------------------------------------------------------------------------------- 1 | # ReaderWriter Component 2 | 3 | This component handles the reading and writing of road space models. 4 | Serialized models have to be mapped on the model implementations of the model component and vice versa. 5 | -------------------------------------------------------------------------------- /rtron-readerwriter/src/main/kotlin/io/rtron/readerwriter/citygml/CitygmlVersion.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.readerwriter.citygml 18 | 19 | import org.citygml4j.core.model.CityGMLVersion as GmlCitygmlVersion 20 | 21 | enum class CitygmlVersion { 22 | V1_0, 23 | V2_0, 24 | V3_0, 25 | } 26 | 27 | fun CitygmlVersion.toGmlCitygml(): GmlCitygmlVersion = 28 | when (this) { 29 | CitygmlVersion.V1_0 -> GmlCitygmlVersion.v1_0 30 | CitygmlVersion.V2_0 -> GmlCitygmlVersion.v2_0 31 | CitygmlVersion.V3_0 -> GmlCitygmlVersion.v3_0 32 | } 33 | -------------------------------------------------------------------------------- /rtron-readerwriter/src/main/kotlin/io/rtron/readerwriter/opendrive/reader/mapper/opendrive14/Opendrive14SignalMapper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.readerwriter.opendrive.reader.mapper.opendrive14 18 | 19 | import arrow.core.Option 20 | import io.rtron.model.opendrive.signal.RoadSignals 21 | import io.rtron.readerwriter.opendrive.reader.mapper.common.OpendriveCommonMapper 22 | import org.asam.opendrive14.OpenDRIVE 23 | import org.mapstruct.Mapper 24 | import org.mapstruct.NullValueCheckStrategy 25 | 26 | @Mapper( 27 | nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, 28 | uses = [OpendriveCommonMapper::class, Opendrive14CoreMapper::class, Opendrive14ObjectMapper::class], 29 | imports = [Option::class], 30 | ) 31 | abstract class Opendrive14SignalMapper { 32 | // 33 | // Signal 34 | // 35 | abstract fun mapSignals(source: OpenDRIVE.Road.Signals): RoadSignals 36 | } 37 | -------------------------------------------------------------------------------- /rtron-readerwriter/src/main/kotlin/io/rtron/readerwriter/opendrive/reader/mapper/opendrive17/Opendrive17Mapper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.readerwriter.opendrive.reader.mapper.opendrive17 18 | 19 | import io.rtron.model.opendrive.OpendriveModel 20 | import org.asam.opendrive17.OpenDRIVE 21 | import org.mapstruct.Mapper 22 | import org.mapstruct.Mapping 23 | import org.mapstruct.NullValueCheckStrategy 24 | 25 | @Mapper(nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS) 26 | abstract class Opendrive17Mapper { 27 | @Mapping(target = "header", ignore = true) 28 | @Mapping(target = "road", ignore = true) 29 | @Mapping(target = "controller", ignore = true) 30 | @Mapping(target = "junction", ignore = true) 31 | abstract fun mapModel(source: OpenDRIVE): OpendriveModel 32 | } 33 | -------------------------------------------------------------------------------- /rtron-readerwriter/src/main/kotlin/io/rtron/readerwriter/opendrive/report/ReportExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.readerwriter.opendrive.report 18 | 19 | import io.rtron.io.issues.Severity 20 | import jakarta.xml.bind.ValidationEvent 21 | 22 | fun ValidationEvent.toIssue(): SchemaValidationIssue { 23 | val text = this.message ?: "" 24 | val severity = 25 | when (this.severity) { 26 | ValidationEvent.WARNING -> Severity.WARNING 27 | ValidationEvent.ERROR -> Severity.ERROR 28 | ValidationEvent.FATAL_ERROR -> Severity.FATAL_ERROR 29 | else -> Severity.WARNING 30 | } 31 | 32 | val lineNumber = this.locator.lineNumber 33 | val columnNumber = this.locator.columnNumber 34 | 35 | return SchemaValidationIssue(text, severity, lineNumber, columnNumber) 36 | } 37 | -------------------------------------------------------------------------------- /rtron-readerwriter/src/main/kotlin/io/rtron/readerwriter/opendrive/report/SchemaValidationIssue.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.readerwriter.opendrive.report 18 | 19 | import io.rtron.io.issues.Severity 20 | import kotlinx.serialization.Serializable 21 | 22 | @Serializable 23 | data class SchemaValidationIssue( 24 | val description: String, 25 | val severity: Severity, 26 | val lineNumber: Int, 27 | val columnNumber: Int, 28 | ) 29 | -------------------------------------------------------------------------------- /rtron-readerwriter/src/main/kotlin/io/rtron/readerwriter/opendrive/report/SchemaValidationReport.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.readerwriter.opendrive.report 18 | 19 | import io.rtron.io.issues.IssueList 20 | import io.rtron.io.issues.Severity 21 | import io.rtron.readerwriter.opendrive.version.OpendriveVersion 22 | import kotlinx.serialization.Serializable 23 | 24 | @Serializable 25 | class SchemaValidationReport( 26 | val opendriveVersion: OpendriveVersion, 27 | val validationIssues: IssueList = IssueList(), 28 | val completedSuccessfully: Boolean = true, 29 | val validationAbortIssue: String = "", 30 | ) { 31 | fun validationProcessAborted() = !completedSuccessfully 32 | 33 | fun containsFatalErrorIssues(): Boolean = validationIssues.getIssues().any { it.severity == Severity.FATAL_ERROR } 34 | } 35 | -------------------------------------------------------------------------------- /rtron-readerwriter/src/main/kotlin/io/rtron/readerwriter/opendrive/writer/mapper/common/OpendriveCommonMapper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.readerwriter.opendrive.writer.mapper.common 18 | 19 | import arrow.core.Option 20 | import arrow.core.getOrElse 21 | import org.mapstruct.Mapper 22 | import org.mapstruct.NullValueCheckStrategy 23 | 24 | @Mapper(nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS) 25 | abstract class OpendriveCommonMapper { 26 | fun mapNullableToOption(source: T?): Option = Option.fromNullable(source) 27 | 28 | fun mapOptionDoubleToNullableDouble(source: Option): Double? = source.getOrElse { return null } 29 | 30 | fun mapOptionStringToNullableString(source: Option): String? = source.getOrElse { return null } 31 | 32 | fun mapOptionIntegerToNullableInteger(source: Option): Int? = source.getOrElse { return null } 33 | } 34 | -------------------------------------------------------------------------------- /rtron-readerwriter/src/main/kotlin/io/rtron/readerwriter/opendrive/writer/mapper/opendrive17/Opendrive17Mapper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.readerwriter.opendrive.writer.mapper.opendrive17 18 | 19 | import io.rtron.model.opendrive.OpendriveModel 20 | import io.rtron.readerwriter.opendrive.writer.mapper.common.OpendriveCommonMapper 21 | import org.asam.opendrive17.OpenDRIVE 22 | import org.mapstruct.Mapper 23 | import org.mapstruct.NullValueCheckStrategy 24 | 25 | @Mapper( 26 | nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS, 27 | uses = [ 28 | OpendriveCommonMapper::class, Opendrive17CoreMapper::class, Opendrive17RoadMapper::class, Opendrive17ObjectMapper::class, 29 | Opendrive17SignalMapper::class, Opendrive17JunctionMapper::class, 30 | ], 31 | ) 32 | abstract class Opendrive17Mapper { 33 | abstract fun mapModel(source: OpendriveModel): OpenDRIVE 34 | } 35 | -------------------------------------------------------------------------------- /rtron-std/README.md: -------------------------------------------------------------------------------- 1 | # Std Component 2 | 3 | This component at the utility level extends standard functionality on collections, lists, sequences as well as the modeling of results. 4 | -------------------------------------------------------------------------------- /rtron-std/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | kotlin("jvm") 3 | } 4 | 5 | kotlinProject() 6 | 7 | dependencies { 8 | // math libraries 9 | implementation(Dependencies.guava) 10 | } 11 | -------------------------------------------------------------------------------- /rtron-std/src/main/kotlin/io/rtron/std/BaseException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.std 18 | 19 | open class BaseException(val message: String) { 20 | // Properties and Initializers 21 | init { 22 | require(message.isNotBlank()) { "Message must not be blank." } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /rtron-std/src/main/kotlin/io/rtron/std/Int.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.std 18 | 19 | fun Boolean.toInt() = if (this) 1 else 0 20 | -------------------------------------------------------------------------------- /rtron-std/src/main/kotlin/io/rtron/std/Option.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.std 18 | 19 | import arrow.core.Option 20 | 21 | /** Handle the None of [Option] with [block] and return the [V]. */ 22 | inline fun Option.handleEmpty(block: (Option) -> Nothing): V = if (isSome()) getOrNull()!! else block(this) 23 | -------------------------------------------------------------------------------- /rtron-std/src/main/kotlin/io/rtron/std/Sets.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.std 18 | 19 | import com.google.common.collect.Sets as GSets 20 | 21 | /** 22 | * Returns the set of all possible subsets. 23 | * See wikipedia article of [power set](http://en.wikipedia.org/wiki/Power_set). 24 | * 25 | * @receiver the set for which all possible subsets are constructed 26 | * @return all possible subsets 27 | */ 28 | fun Set.powerSet(): Set> = GSets.powerSet(this) 29 | 30 | /** 31 | * Returns all possible subsets of [this] with [size]. 32 | * 33 | * @receiver the set for which all possible subsets with [size] are constructed 34 | * @param size the number of elements per combination 35 | * @return all possible subsets of provided [size] 36 | */ 37 | fun Set.combinations(size: Int): Set> = GSets.combinations(this, size) 38 | -------------------------------------------------------------------------------- /rtron-std/src/test/kotlin/io/rtron/std/SetsKtTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.std 18 | 19 | import io.kotest.core.spec.style.FunSpec 20 | import io.kotest.matchers.shouldBe 21 | 22 | class SetsKtTest : FunSpec({ 23 | context("TestCombinations") { 24 | 25 | test("test basic combination generation") { 26 | val startSet = setOf("a", "b", "c") 27 | val expectedCombinations = 28 | setOf( 29 | setOf("a", "b"), 30 | setOf("a", "c"), 31 | setOf("b", "c"), 32 | ) 33 | 34 | val actualCombinations = startSet.combinations(2) 35 | 36 | actualCombinations shouldBe expectedCombinations 37 | } 38 | } 39 | }) 40 | -------------------------------------------------------------------------------- /rtron-transformer/README.md: -------------------------------------------------------------------------------- 1 | # Transformer Component 2 | 3 | This component contains transformers that take a model from the model component, convert it to a different one and return it. 4 | -------------------------------------------------------------------------------- /rtron-transformer/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | kotlin("jvm") 3 | kotlin(Plugins.serialization) version PluginVersions.serialization 4 | } 5 | 6 | kotlinProject() 7 | 8 | dependencies { 9 | // utility layer components 10 | implementation(project(ProjectComponents.standard)) 11 | implementation(project(ProjectComponents.inputOutput)) 12 | implementation(project(ProjectComponents.math)) 13 | 14 | // single model processing layer components 15 | implementation(project(ProjectComponents.model)) 16 | 17 | // object creation libraries 18 | implementation(Dependencies.kotlinxSerializationJson) 19 | 20 | // logging libraries 21 | implementation(Dependencies.kotlinLogging) 22 | implementation(Dependencies.slf4jSimple) 23 | 24 | // geo libraries 25 | implementation(Dependencies.proj4) 26 | implementation(Dependencies.proj4Epsg) 27 | implementation(Dependencies.citygml4jXml) 28 | } 29 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/converter/opendrive2roadspaces/report/Opendrive2RoadspacesReport.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.converter.opendrive2roadspaces.report 18 | 19 | import io.rtron.io.issues.DefaultIssueList 20 | import io.rtron.io.issues.getTextSummary 21 | import io.rtron.transformer.converter.opendrive2roadspaces.Opendrive2RoadspacesParameters 22 | import kotlinx.serialization.Serializable 23 | 24 | @Serializable 25 | data class Opendrive2RoadspacesReport( 26 | val parameters: Opendrive2RoadspacesParameters, 27 | val conversion: DefaultIssueList = DefaultIssueList(), 28 | ) { 29 | // Methods 30 | fun getTextSummary(): String = conversion.getTextSummary() 31 | } 32 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/converter/roadspaces2citygml/geometry/AbstractOccupiedSpaceExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.converter.roadspaces2citygml.geometry 18 | 19 | import org.citygml4j.core.model.core.AbstractOccupiedSpace 20 | 21 | /** 22 | * Populates the LOD implicit geometry of an [AbstractOccupiedSpace] object with the source geometries of the [GeometryTransformer]. 23 | * 24 | * @param geometryTransformer source geometries 25 | */ 26 | fun AbstractOccupiedSpace.populateLod1ImplicitGeometry(geometryTransformer: GeometryTransformer) { 27 | val implicitGeometryPropertyResult = geometryTransformer.getImplicitGeometry() 28 | require(implicitGeometryPropertyResult.isSome()) { "Must contain implicit geometry." } 29 | 30 | lod1ImplicitRepresentation = implicitGeometryPropertyResult.getOrNull()!! 31 | } 32 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/converter/roadspaces2citygml/geometry/MathTransformer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.converter.roadspaces2citygml.geometry 18 | 19 | import io.rtron.math.transform.Affine3D 20 | import org.citygml4j.core.model.core.TransformationMatrix4x4 as GmlTransformationMatrix4x4 21 | 22 | /** 23 | * Converts a [GmlTransformationMatrix4x4] object from an affine matrix. 24 | */ 25 | fun Affine3D.toGmlTransformationMatrix4x4(): GmlTransformationMatrix4x4 = GmlTransformationMatrix4x4.ofRowMajor(toDoubleList()) 26 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/converter/roadspaces2citygml/report/Roadspaces2CitygmlReport.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.converter.roadspaces2citygml.report 18 | 19 | import io.rtron.io.issues.DefaultIssueList 20 | import io.rtron.io.issues.getTextSummary 21 | import io.rtron.transformer.converter.roadspaces2citygml.Roadspaces2CitygmlParameters 22 | import kotlinx.serialization.Serializable 23 | 24 | @Serializable 25 | data class Roadspaces2CitygmlReport( 26 | val parameters: Roadspaces2CitygmlParameters, 27 | val conversion: DefaultIssueList = DefaultIssueList(), 28 | ) { 29 | // Methods 30 | fun getTextSummary(): String = conversion.getTextSummary() 31 | } 32 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/evaluator/opendrive/plans/AbstractOpendriveEvaluator.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.evaluator.opendrive.plans 18 | 19 | import io.rtron.io.issues.ContextIssueList 20 | import io.rtron.model.opendrive.OpendriveModel 21 | 22 | abstract class AbstractOpendriveEvaluator { 23 | // Methods 24 | abstract fun evaluate(opendriveModel: OpendriveModel): ContextIssueList 25 | } 26 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/evaluator/roadspaces/RoadspacesEvaluatorParameters.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.evaluator.roadspaces 18 | 19 | import kotlinx.serialization.Serializable 20 | 21 | /** 22 | * Parameters for the OpenDRIVE validator. 23 | */ 24 | @Serializable 25 | data class RoadspacesEvaluatorParameters( 26 | val numberTolerance: Double, 27 | val laneTransitionDistanceTolerance: Double, 28 | ) { 29 | companion object { 30 | const val DEFAULT_LANE_TRANSITION_DISTANCE_TOLERANCE = 1E-3 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/evaluator/roadspaces/plans/AbstractRoadspacesEvaluator.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.evaluator.roadspaces.plans 18 | 19 | import io.rtron.io.issues.DefaultIssueList 20 | import io.rtron.model.roadspaces.RoadspacesModel 21 | 22 | abstract class AbstractRoadspacesEvaluator { 23 | // Methods 24 | abstract fun evaluate(roadspacesModel: RoadspacesModel): DefaultIssueList 25 | } 26 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/evaluator/roadspaces/report/RoadspacesEvaluationReport.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.evaluator.roadspaces.report 18 | 19 | import io.rtron.io.issues.DefaultIssueList 20 | import io.rtron.transformer.evaluator.roadspaces.RoadspacesEvaluatorParameters 21 | import kotlinx.serialization.Serializable 22 | 23 | @Serializable 24 | data class RoadspacesEvaluationReport( 25 | val parameters: RoadspacesEvaluatorParameters, 26 | var modelingRulesEvaluation: DefaultIssueList = DefaultIssueList(), 27 | ) 28 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/modifiers/opendrive/cropper/OpendriveCropperReport.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.modifiers.opendrive.cropper 18 | 19 | import kotlinx.serialization.Serializable 20 | 21 | @Serializable 22 | data class OpendriveCropperReport( 23 | val parameters: OpendriveCropperParameters, 24 | var message: String = "", 25 | var numberOfRoadsOriginally: Int = 0, 26 | var numberOfRoadsRemaining: Int = 0, 27 | var numberOfJunctionsOriginally: Int = 0, 28 | var numberOfJunctionsRemaining: Int = 0, 29 | ) 30 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/modifiers/opendrive/offset/adder/OpendriveOffsetAdderReport.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.modifiers.opendrive.offset.adder 18 | 19 | import kotlinx.serialization.Serializable 20 | 21 | @Serializable 22 | data class OpendriveOffsetAdderReport( 23 | val parameters: OpendriveOffsetAdderParameters, 24 | ) 25 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/modifiers/opendrive/offset/resolver/OpendriveOffsetResolverReport.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.modifiers.opendrive.offset.resolver 18 | 19 | import kotlinx.serialization.Serializable 20 | 21 | @Serializable 22 | data class OpendriveOffsetResolverReport( 23 | var messages: List = emptyList(), 24 | ) 25 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/modifiers/opendrive/remover/OpendriveObjectRemoverParameters.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.modifiers.opendrive.remover 18 | 19 | import io.rtron.model.opendrive.objects.EObjectType 20 | import kotlinx.serialization.Serializable 21 | 22 | @Serializable 23 | data class OpendriveObjectRemoverParameters( 24 | /** remove road objects without type */ 25 | val removeRoadObjectsWithoutType: Boolean, 26 | /** remove road objects of type */ 27 | val removeRoadObjectsOfTypes: Set, 28 | ) { 29 | companion object { 30 | val DEFAULT_REMOVE_ROAD_OBJECTS_WITHOUT_TYPE = false 31 | val DEFAULT_REMOVE_ROAD_OBJECTS_OF_TYPES = emptySet() 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/modifiers/opendrive/remover/OpendriveObjectRemoverReport.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.modifiers.opendrive.remover 18 | 19 | import io.rtron.model.opendrive.objects.EObjectType 20 | import kotlinx.serialization.Serializable 21 | 22 | @Serializable 23 | data class OpendriveObjectRemoverReport( 24 | val parameters: OpendriveObjectRemoverParameters, 25 | var numberOfRemovedRoadObjectsWithoutType: Int = 0, 26 | val numberOfRemovedRoadObjectsWithType: MutableMap = mutableMapOf(), 27 | ) 28 | -------------------------------------------------------------------------------- /rtron-transformer/src/main/kotlin/io/rtron/transformer/modifiers/opendrive/reprojector/OpendriveReprojectorReport.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 Chair of Geoinformatics, Technical University of Munich 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.rtron.transformer.modifiers.opendrive.reprojector 18 | 19 | import kotlinx.serialization.Serializable 20 | 21 | @Serializable 22 | data class OpendriveReprojectorReport( 23 | val parameters: OpendriveReprojectorParameters, 24 | var message: String = "", 25 | var maximumDeviation: Double = 0.0, 26 | ) 27 | -------------------------------------------------------------------------------- /rtron-transformer/src/test/kotlin/io/rtron/transformer/modifiers/opendrive/reprojector/OpendriveReprojectorTest.kt: -------------------------------------------------------------------------------- 1 | package io.rtron.transformer.modifiers.opendrive.reprojector 2 | 3 | import io.kotest.core.spec.style.FunSpec 4 | import io.kotest.matchers.doubles.plusOrMinus 5 | import io.kotest.matchers.shouldBe 6 | import org.locationtech.proj4j.CRSFactory 7 | import org.locationtech.proj4j.CoordinateReferenceSystem 8 | import org.locationtech.proj4j.CoordinateTransform 9 | import org.locationtech.proj4j.CoordinateTransformFactory 10 | import org.locationtech.proj4j.ProjCoordinate 11 | 12 | class OpendriveReprojectorTest : FunSpec({ 13 | 14 | test("basic coordinate projection works") { 15 | val crsFactory = CRSFactory() 16 | val sourceCrs: CoordinateReferenceSystem = 17 | crsFactory.createFromParameters( 18 | "WGS84", 19 | "+proj=tmerc +lat_0=48.1485460905528 +lon_0=11.5679503890009 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs", 20 | ) 21 | val targetCrs = crsFactory.createFromName("epsg:25832") 22 | val wgsToUtm: CoordinateTransform = CoordinateTransformFactory().createTransform(sourceCrs, targetCrs) 23 | val sourceCoordinate = ProjCoordinate(167.3432219777634, -277.563889501929, 0.15239999999999998) 24 | 25 | val result = ProjCoordinate() 26 | wgsToUtm.transform(sourceCoordinate, result) 27 | 28 | result.x.shouldBe(691176.5699790819 plusOrMinus 0.000001) 29 | result.y shouldBe(5335728.14692931 plusOrMinus 0.000001) 30 | } 31 | }) 32 | -------------------------------------------------------------------------------- /samples/datasets-output/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /samples/datasets/README.md: -------------------------------------------------------------------------------- 1 | # Sample Datasets 2 | 3 | This directory contains sample datasets created with [MathWorks RoadRunenr](https://mathworks.com/products/roadrunner.html). 4 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | // user interface layer 2 | include("rtron-cli") 3 | 4 | // batch processing layer 5 | include("rtron-main") 6 | 7 | // single model processing layer 8 | include("rtron-model", "rtron-readerwriter", "rtron-transformer") 9 | 10 | // utility layer 11 | include("rtron-std", "rtron-io", "rtron-math") 12 | --------------------------------------------------------------------------------