This repository includes the development of district heating network creator using urban street layouts. Using geospatial data, we extract potential routes and connections for heating pipelines directly from street networks.
Go to file
Majid Rezaei 1cbb9d5f48 fix/isolated-nodes-bug-fix (#1)
changing the graph generation algorithm

Authored-by: Majid Rezaei <majidrezaee734@gmail.com>
Reviewed-on: https://nextgenerations-cities.encs.concordia.ca/gitea/a_rezaei/district_heating_network_analysis/pulls/1
2024-06-10 22:50:27 -04:00
input_files fix/isolated-nodes-bug-fix (#1) 2024-06-10 22:50:27 -04:00
Scripts fix/isolated-nodes-bug-fix (#1) 2024-06-10 22:50:27 -04:00
.gitignore fix main and geojson file 2024-06-07 09:23:01 -04:00
DistrictHeatingNetworkCreator.py fix/isolated-nodes-bug-fix (#1) 2024-06-10 22:50:27 -04:00
main.py fix/isolated-nodes-bug-fix (#1) 2024-06-10 22:50:27 -04:00
README.md dhn_generator - class, example files and an example main file 2024-01-24 17:46:14 -05:00
test_some_stuff.ipynb fix/isolated-nodes-bug-fix (#1) 2024-06-10 22:50:27 -04:00

District Heating Network Creator

Introduction

The DistrictHeatingNetworkCreator class is designed to process geospatial data for district heating networks. It takes building and road data as input, identifies the nearest road to each building centroid, processes intersections, and creates a network graph representing the district heating system.

Installation

Before using DistrictHeatingNetworkCreator, ensure that the required libraries are installed. You can install them using pip:

pip install geopandas networkx matplotlib shapely

Usage

To use the DistrictHeatingNetworkCreator, follow these steps:

  1. Initialize the class with paths to your GeoJSON file containing building data and Shapefile containing road data.

    Example files:

    • buildings.geojson: A GeoJSON file containing building data.
    • montreal_roads.shp: A Shapefile containing road data for Montreal.
  2. Call the run method to process the data and create the network graph.

  3. Optionally, call the plot_network_graph method to visualize the network.

Example:

from DistrictHeatingNetworkCreator import DistrictHeatingNetworkCreator

# Initialize the class
network_creator = DistrictHeatingNetworkCreator('path/to/buildings.geojson', 'path/to/montreal_roads.shp')

# Create the network graph
network_graph = network_creator.run()

# Plot the network graph (optional)
network_creator.plot_network_graph(network_graph)

Class Methods

__init__(self, buildings_file, roads_file)

Initializes the class with paths to the building and road data files.

  • buildings_file: Path to the GeoJSON file containing building data.
  • roads_file: Path to the Shapefile containing road data.

run(self)

Executes the district heating network creation process. Returns a NetworkX graph representing the network.

_load_and_process_data(self)

Loads and processes the building and road data from the specified files.

_find_nearest_roads(self)

Identifies the nearest road for each building centroid and calculates the nearest point on these roads.

_process_intersections(self)

Processes intersections and creates final geometries for the network graph.

_create_network_graph(self)

Creates a NetworkX graph from the processed geospatial data, representing the district heating network.

plot_network_graph(self, network_graph)

Plots the network graph using matplotlib and networkx.

  • network_graph: The NetworkX graph to be plotted.