This repository holds the source code for my thesis for the fulfillment of the degree of MSc Science in Geomatics for the built environment. The MSc Title was awarded on November 9th 2017.
!! Note: Some data is removed from this repository for copyright purposes. Therefore, code in this repository will not execute properly. Transformer data and validation data should be retrieved somewhere else.
There are three main sources for the input data:
- BAG buildings as polygons and address points
- NWB (National Road Network) as polylines
- Transformers as points
These three datasources have to be processed and cleaned before usage in the method. This consists of the following steps:
- Find all address and VBO points within each building
- Add the id's of all points within a building as attribute to that building
- Find the most occurring address point for each building and select that as 'building point'
Optional:
3a. Find the nearest neighbors for all buildings
3b. Group neighboring buildings together
- Save building points
- Connect buildings and transformers to the NWB using GRASS GIS and QGIS Networks plugin
5a. Method A: Connect to Closest Point on the street network
5b. Method B: Connect to Closest Junction Vertex on the street network
5c. Method C: Iteratively Connect to the Closest Junction Vertex on the street network
A: Order Closest Point
- Connect NWB with trafos & blds
- Build graph (Network)
- Join on location (Network + blds + trafos)
- Add type attribute
- Check
- Add length attribute to NWB
B: Order Closest Junction
- Split NWB in segments (for example 75m)
- Extract nodes and save as endpoints shapefile
- Run connect2ClosestPoint in python, for blds and trafo's
- Merge WKT blds and trafo's with NWB
- v.clean -snap t=0.100000
- v.clean -break t=0.100000
- Build graph (Network)
- Join on location (Network + blds + trafos)
- Add type attribute
- Add length attribute to NWB
C: Order Iterative Closest Junction
- Import maps in GRASS
- v.net -connect NWB with trafos and then blds
- Build graph (Network)
- Join on location (Network + blds + trafos)
- Add type attribute
- Check
- Add length attribute to NWB
- Read in Graph in NetworkX format
- Find all paths from all buildings to the closest transformer
- Calculate edge betweenness for all edges in the network
- Calculate Thickness & Current
- Quantify cables