gdal-opendrive-how-to

OpenDRIVE vector driver for GDAL

The driver has been added in GDAL release 3.10.

Getting hands on

Pull one of the two Docker images which have the driver already included:

For example, spawning the Alpine container, verify availability of the driver by calling ogrinfo --format XODR:

docker run --rm -it ghcr.io/osgeo/gdal:alpine-normal-latest ogrinfo --format XODR

Format Details:
  Short Name: XODR
  Long Name: OpenDRIVE - Open Dynamic Road Information for Vehicle Environment
  Supports: Vector
  Supports: Open() - Open existing dataset.
<OpenOptionList>
  ...
</OpenOptionList>

You can now use the new driver functions through the Docker container. For example, use ogr2ogr to convert a local .xodr file into GeoPackage, or into any other supported OGR output format:

docker run --rm -v ${PWD}:/home -it ghcr.io/osgeo/gdal:alpine-normal-latest ogr2ogr -f "GPKG" /home/<file>.gpkg /home/<file>.xodr

QGIS Demo

Our goal is to make these functions conveniently usable through the official GDAL distribution in future, thus, also enabling drag-and-drop of XODR into QGIS. The following video shows the current workaround through a previously created GeoPackage.

Context references