from a set of points I built the Voronoi tessellation using scipy:
from scipy.spatial import Voronoi
vor = Voronoi(points)
Now I would like
The library is able to generate ordered list of coordinates, you just need to make use of the index lists provided:
import numpy as np
from scipy.spatial import Voronoi
...
ids = np.array(my_points_list)
vor = Voronoi(points)
polygons = {}
for id, region_index in enumerate(vor.point_region):
points = []
for vertex_index in vor.regions[region_index]:
if vertex_index != -1: # the library uses this for infinity
points.append(list(vor.vertices[vertex_index]))
points.append(points[0])
polygons[id]=points
each polygon in the polygons dictionary can be exported to geojson or brought into shapely and I was able to render them properly in QGIS