Hex-based Urban Network Comparative Analytics
This repository provides a reproducible Python workflow for hexagonal spatial aggregation of urban network attributes, designed for applications in urban analytics, walkability modelling, and network-based spatial analysis. The script extracts connected network components, generates a regular hex grid, aggregates multiple network layers into hex cells, and exports clean, publication-ready spatial outputs. The main aim is to compare different urban network models across each other; using their attributes (e.g. centarlity measurments, geometric characteristics)
Methodological Overview
The workflow follows these steps:
-
Network connectivity extraction o Starting from a seed feature ID, all topologically connected network segments are extracted.
-
Hexagonal tessellation o A regular hex grid is generated over the spatial extent of the connected network.
-
Spatial aggregation o Multiple network layers are intersected with the hex grid. o Numeric attributes are aggregated per hex cell using:
Mean
Maximum
-
Post-processing o Full hex grid with statistics o Cleaned hex grid excluding cells with NULL values
Input Data
The script expects GeoPackage (GPKG) inputs:
• M1 — Primary urban network layer
• M2 — Secondary network layer
Each layer must:
• Contain valid geometries
• Use or be reprojectable to EPSG:6312
• Have numeric attributes suitable for aggregation
Output Data
The script generates a single GeoPackage containing two layers:
1. Full hex grid
o All hex cells
o Aggregated statistics (mean + max)
2. Cleaned hex grid
o Hex cells with no NULL values across aggregated attributes
Configuration Parameters
Key parameters are defined at the top of hex_grid_analysis.py:
• START_FEATURE_ID — Seed network segment ID
• HEX_SIZE — Hexagon radius (map units)
• TARGET_EPSG — Target CRS
• Input/output file paths and layer names
These can be easily adapted for other cities or scales.
License
This project is released under the MIT License.
Citation
If you use this code in academic work, cite as:
Abdeldayem, W., Geddes, I., Eldesoky, A. H., Stavroulaki, I., Simons, G., Berghauser Pont, M., & Charalambous, N. (2025). Automated versus Hybrid Street Network Modelling for Centrality and Accessibility Analysis. Zenodo. https://doi.org/10.5281/zenodo.16609014