Deploy the Run Scripts

In order to run the r:trån scripts in deployment environments, kscript needs to be installed. kscript provides enhanced scripting support for Kotlin and is capable of executing the *.kts scripts contained in this directory.

To execute the scripts, you can either install kscript directly on the system or use a Docker container that comes with kscript preinstalled.

Via a direct kscript installation

sdkman is a tool for managing software development kits and conveniently installs kotlin and kscript:

curl -s "https://get.sdkman.io" | bash     # install sdkman
source "$HOME/.sdkman/bin/sdkman-init.sh"  # add sdkman to PATH

sdk install java # install java
sdk install kotlin # install Kotlin
sdk install kscript # install kscript

If you are on Windows, the deployment via docker is recommended.

Once the environment is ready, the r:trån scripts can be executed:

# download the script ...
curl https://raw.githubusercontent.com/tum-gis/rtron/main/rtron-main/src/main/resources/scripts/convert-opendrive-to-citygml2-simple.kts --output convert-opendrive-to-citygml2-simple.kts

# and simply execute it (dependencies are resolved automatically)
kscript ./convert-opendrive-to-citygml2-simple.kts

Via Docker

With a docker installation, the run scripts can be executed using the r:trån container. First, download the example script:

curl https://raw.githubusercontent.com/tum-gis/rtron/main/rtron-main/src/main/resources/scripts/convert-opendrive-to-citygml2-simple.kts \
    --output convert-opendrive-to-citygml2-simple.kts

Then, adapt /adjust/path/... to your host system's paths and run the execution:

docker run -i --name rtron --rm \
           -v /adjust/path/to/input-datasets:/project/input \
           -v /adjust/path/to/output-datasets:/project/output \
           rtron/rtron - < /adjust/path/to/convert-opendrive-to-citygml2-simple.kts

Also note that the script must now reference paths in the container file system (/project/input, /project/output).

To cancel the process, run this command in another terminal:

docker rm -f rtron