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:
python -m venv venv source venv/bin/activate # Linux/Mac venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
Batch Convert CityJSON to IFC
Make the
batch_converter
script executable or run it using Python:chmod +x batch_converter # Make it executable (Linux/Mac) ./batch_converter /path/to/cityjson_folder /path/to/output_ifc_folder # Run directly python batch_converter /path/to/cityjson_folder /path/to/output_ifc_folder # Or via Python
-
Parameters:
/path/to/cityjson_folder
: Directory containing one or more.json
(CityJSON) files from 3DBAG./path/to/output_ifc_folder
: Directory where the generated IFC files will be saved.
-
Example Execution:
python batch_converter ./cityjson_data ./ifc_output
This command processes all CityJSON files in
./cityjson_data
and saves IFC files into./ifc_output
.
- 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.