XPlan-Tools
A Python library to provide some useful means when working with XPlanung and XTrasse data, e.g. format conversion, version migration and database setup. Relies on Pydantic for a Python representation of the XPlanung/XTrasse model as well as serialization/de-serialization and validation.
While it comes with a CLI, its modules are also meant to provide other applications a Python representation as well as an interface for XPlanung/XTrasse data.
Features
- Conversion between GML, JSON-FG and DB encodings of XPlanung/XTrasse data.
- Migration from older versions of XPlanung to the latest one.
- Set up a database to store XPlanung data. Supports PostgreSQL/PostGIS as well as GeoPackage and SpatiaLite SQLite databases.
- Transformation from XPlanung to INSPIRE PLU based on the official mappings.
- Adding style properties (stylesheetId, schriftinhalt) to XPlanung presentational objects based on defined rules.
Installation
Pixi
This project uses Pixi for package management. To install this repo with a self-contained environment, run
git clone https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools.git
cd xplan-tools
pixi install
Python >= v3.10
GDAL and its Python bindings are required, so you need to make sure the GDAL system library and Python package versions match.
Download the repository:
git clone https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools.git
cd xplan-tools
pip install .
Docker
Images are provided in the container registry (see docs).
Development
Make sure Pixi is installed and run
License
The code in this repository is licensed under the EUPL-1.2-or-later
© XLeitstelle, 2025