bug: `add_edge_population` fails is there are two GHSL tiles overlapping the study area
Assessment
This issue has not been assessed yet.
Description
Hi @cbueth
When the study area overlaps more than one of the GHSL tiles, the function add_edge_population returns an error.
Here is a reprex for this behaviour
import osmnx as ox
from superblockify.population.approximation import add_edge_population
boundary_lat, boundary_lon = 41.8956456, 12.4655397
graph = ox.graph_from_point(
(boundary_lat, boundary_lon),
dist=500,
network_type='drive',
simplify=True
)
graph = ox.add_edge_speeds(graph)
graph = ox.add_edge_travel_times(graph)
graph = ox.project_graph(graph)
add_edge_population(graph, overwrite=True)
# 2026-04-01 12:21:54,478 | INFO | tessellation.py:101 | Calculating edge cells for graph with 165 edges.
# 2026-04-01 12:21:54,609 | INFO | tessellation.py:155 | Tessellated 132 edge cells in 0:00:00.
# 2026-04-01 12:21:54,672 | INFO | ghsl.py:129 | Using the GHSL raster tiles for the bounding box (1039130.3128053441, 4999534.908906185, 1040472.7243228266, 5000784.670403941).
# TypeError: invalid path or file: ['/home/juan/create-toy-nets/data/ghsl/GHS_POP_E2025_GLOBE_R2023A_54009_100_V1_0_R4_C20.tif', '/home/juan/create-toy-nets/data/ghsl/GHS_POP_E2025_GLOBE_R2023A_54009_100_V1_0_R5_C20.tif']
# Cell In[56], line 1
# ----> 1 add_edge_population(graph, overwrite=True)
To fix this, we will need to preprocess the tiles beforehand. The changes shouldn't be too long
- Dominant language
- Python
- Stars
- 33
- Forks
- 4
- Avg merge
- 3h 15m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BikeNetKit/superblockify
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
BikeNetKit/superblockify#136 · 1 comment ·
-
bug: gdal required Openbug
Difficulty 1/5 Under an hour Newbie friendliness 78/100
BikeNetKit/superblockify#135 · 3 comments ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
BikeNetKit/superblockify#132 · 6 comments ·
-
feat: Map coloring Openenhancement good first issue
Difficulty 5/5 Over a week Newbie friendliness 35/100
BikeNetKit/superblockify#130 · 2 comments ·
-
enhancement good first issue
BikeNetKit/superblockify#106 · 1 reaction · 1 assignee ·
All issues in BikeNetKit/superblockify
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stephrobert/dsoxlab#238 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
sublimehq/package_control#1780 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
nwg-piotr/nwg-displays#145 ·