All changes
This commit is contained in:
parent
593f380581
commit
49f7ec2f5a
60 changed files with 1783 additions and 679 deletions
|
|
@ -2,6 +2,7 @@ from collections import defaultdict
|
|||
|
||||
import numpy as np
|
||||
from scipy.spatial import Voronoi
|
||||
from scipy.spatial.qhull import QhullError
|
||||
from shapely import make_valid
|
||||
from shapely.geometry import MultiPolygon, Polygon
|
||||
from shapely.ops import unary_union
|
||||
|
|
@ -67,7 +68,7 @@ def compute_voronoi_regions(
|
|||
|
||||
try:
|
||||
vor = Voronoi(all_points)
|
||||
except Exception:
|
||||
except (ValueError, QhullError):
|
||||
# Fallback: split boundary equally among all postcodes present
|
||||
all_pcs = list(dict.fromkeys(unique_pcs))
|
||||
if len(all_pcs) == 1:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue