Urban design and energy management are two crucial components of sustainable city planning. However, merging them can be challenging due to the variance in the data types and formats they traditionally use. Enter our Python script, which seamlessly transforms GeoJSON data, representing urban structures, into a format suitable for the renowned EnergyPlus simulation engine.
Setting Up the Environment
Installation:
Before diving into the transformation process, ensure your environment is well-equipped:
pip install -U dragonfly-core 
pip install dragonfly-energy
Additionally, make sure all dependencies for Honeybee-energy, which acts as a bridge between the Dragonfly model and EnergyPlus, are satisfied. Using the Ladybug Tools pollination installer is a good practice.
Getting Your Data Ready
The primary input is your city's city.geojson, placed inside the data folder. An optional clip.geojson can be provided to demarcate specific boundaries. Buildings outside these bounds will be set as context shades, ensuring they don’t actively participate in energy simulations but still influence them.
Executing The Workflow
From your terminal or command prompt:
cd path/to/workflows 
python .\workflow_geojson_to_DF.py --directory_path <..\relative\path\to\geojson\directory>
Numerous optional flags provide flexibility, such as --multiplier for scaling building properties, and --generate_DFenriched_geojson to produce a geoJSON with Dragonfly energy-related attributes. You can also filter buildings based on their height and area.
A Peek into the Script's Operation
The script's core function is to convert building information from the GeoJSON into EnergyPlus (IDF) and gbXML models, which are primed for energy simulations.
Core Steps:
Data Enrichment: Begin by generating an enriched GeoJSON, embedding building properties and city boundaries.
Dragonfly Model Generation: Convert the enriched GeoJSON into a Dragonfly city model, adjusting building properties.
Building Program Mapping: Associate building types from the GeoJSON with energy profiles in Dragonfly.
Serialization & Conversion: The Dragonfly model is converted to Honeybee energy models and further serialized into EnergyPlus and gbXML formats.
These processes ensure that urban geometries in the GeoJSON are not just transformed into energy simulation formats but are also imbued with energy characteristics aligned with their function or type.
Adapting the Workflow for Jupyter Notebooks
For those preferring Jupyter Notebooks:
from workflows.workflow_geojson_to_DF 
import generate_EP_assets 
import os 
# Set working directory 
os.chdir('<full_path_to_geojson_directory>') 
# Execute the function 
generate_EP_assets( '<your_file.geojson>', generate_DFenriched_geojson=True, filter_height_less_than=3, filter_height_greater_than=100, filter_area_less_than=100 )
Wrapping Up
The marriage of urban design data with energy simulations is a significant stride towards smart, sustainable city planning. By leveraging the power of GeoJSON, Dragonfly, Honeybee, and EnergyPlus, urban planners can now access a streamlined workflow to visualize and analyze the energy impact of their designs.
This work is a part of the Digital Twins City Center at Chalmers University of Technology
Check it out on github
Back to Top