tum-gis / rtron

r:trån is a road space model transformer library for OpenDRIVE, CityGML and beyond
https://rtron.io
Apache License 2.0
47 stars 12 forks source link

OpenDRIVE Version #31

Closed shariquetaj closed 1 year ago

shariquetaj commented 1 year ago

How to change the input version of opendrive to any specific version available. Also, is it possible to output a corrected odr-file in the same version as input along with or instead of 1.7? If not, what changes should have to be done to fulfill these requirements.

benediktschwab commented 1 year ago

The OpenDRIVE version of the input datasets is automatically identified by an inspection of the header element. Can you elaborate on your question?

Concerning the version of the output dataset: rtron reads the input dataset and maps it onto an internal implementation of OpenDRIVE (following the current version 1.7.0). Based on this, the rules are evaluated with minor fixing procedures. Then, it is mapped back to the JAXB generated data structures and written out. That means, if you need another version, the respective mapping needs to be implemented. You can find the mapping to the JAXB generated classes of version 1.7.0 here. The mappings are semi-automatically derived using the library MapStruct. The benefit of this approach is that the reading/writing and the mapping are type safe making it more robust and easier to maintain.

shariquetaj commented 1 year ago

Is it possible to validate opendrive files in versions other than 1.4?

benediktschwab commented 1 year ago

Yes, sure. The schema validation works for all 1.x versions. The mapping to the internal OpenDRIVE implementation is currently implemented for 1.4 and 1.6. Those mappers are used as fallback for the other versions. Then, the rules on of specification are evaluated on the internal OpenDRIVE implementation (works quite well for me right now). For more details, I’d like to refer you to this article: https://isprs-annals.copernicus.org/articles/X-4-W2-2022/257/2022/