Skip to content

XPlan-Tools

coverage report pipeline status Latest Release

Documentation | Repository

A Python library to provide some useful means when working with XPlanung data, e.g. format conversion, version migration and database setup. Relies on Pydantic for a Python representation of the XPlanung 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 data.

Features

  • Conversion between GML, JSON-FG and DB encodings of XPlanung 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

Docker

Images are provided in the container registry (see docs).

Python >= v3.10

GDAL (v3.6.3 or later) and its Python bindings are required. Since installation can be quite cumbersome, it's not automatically installed. See OS-specific instructions.

Download the repository:

git clone https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools.git
cd xplan-tools

Linux

Install the binary distribution of GDAL, e.g. via package manager, then run

make install

Windows

It is recommended to install GDAL via one of the unofficial wheels available at https://github.com/cgohlke/geospatial-wheels, e.g.

pip install https://github.com/cgohlke/geospatial-wheels/releases/download/v2024.2.18/GDAL-3.8.4-cp310-cp310-win_amd64.whl
Then run
pip install -r requirements.txt

Windows Executables

Download and run an executable available under Packages.

Development

Install the binary distribution of GDAL, e.g. via package manager, then run

git clone https://gitlab.opencode.de/xleitstelle/xplanung/xplan-tools.git
cd xplan-tools
make dev

License

The code in this repository is licensed under the EUPL-1.2-or-later

© XLeitstelle, 2024