This repository provides scripts and modified library files to convert 3DBAG CityJSON files into the Industry Foundation Classes (IFC) format. It leverages modified versions of ifccityjson from the IfcOpenShell project to handle conversion logic.
-
batch_converter
Main script to process multiple CityJSON files in batch and produce corresponding IFC files. -
cityjson2ifc.py
andgeometry.py
Customized modules based on the ifccityjson library. Changes could include additional geometry handling, feature support, or bug fixes specifically for the 3DBAG dataset.
- Batch Conversion: Convert entire folders of 3DBAG CityJSON files into separate zipped IFC files for each tile in a single run.
- Custom Logic: Enhanced geometry and attribute handling tailored to the 3DBAG dataset.
- Command-Line Interface: Simple CLI usage — provide the input folder and the output folder to generate IFCs.
-
Clone this repository:
git clone https://github.com/tudelft3d/IFC3DBAG.git cd IFC3DBAG
-
(Optional) Create a virtual environment:
For linux:
python -m venv .venv
source .venv/bin/activate
For Windows:
python -m venv .venv
.venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Batch Convert CityJSON to IFC
python3 batch_converter.py --input_dir /dir/to/cityjsongz
-
Arguments:
--input_dir
: Used to difine the directory containing one or more compressed CityJSON files (city.json.gz
) (CityJSON) from 3DBAG.--ignore_duplicate
: Ignore duplicate JSON keys in the CityJSON files.
- Fork the repository.
- Create a branch for your feature/fix:
git checkout -b feature/some-improvement
- Commit your changes:
git commit -am 'Add some improvement'
- Push to your branch:
git push origin feature/some-improvement
- Open a Pull Request on GitHub.
For questions or suggestions, feel free to open an issue.