citygml2pgsql converts buildings found in a CityGML file to MultiPolygon insert statements aimed at PosgresSQL/PostGIS.
CREATE TABLE public.buildings (
id text NOT NULL,
filename text,
roof public.geometry(MultiPolygonZ,3857),
wall public.geometry(MultiPolygonZ,3857),
ground public.geometry(MultiPolygonZ,3857),
footprint public.geometry(MultiPolygon,3857),
bl character(2)
);
CREATE TABLE public.imports (
filename text,
md5sum character(32),
count integer,
bundesland text
);
Configure database, column names and target SRS in config.yaml
.
Then, run
uv run citygml2pgsql <input_folder> <input_srs> <lod> --bundesland bl
# e.g.
uv run citygml2pgsql data/gml_files_bw/ 25832 lod2 --bundesland bw
Our work was funded by BMBF Prototype Fund:

Forked from https://gitlab.com/Oslandia/citygml2pgsql. Original Credits:
This plugin has been developed by Oslandia ( http://www.oslandia.com ).
First release was funded by European Union (FEDER related to the e-PLU project) and by Oslandia.
This work is free software and licenced under the MIT licence. See LICENSE file.