Shapely Voronoi cells need ordered=True to match site order
@prranitarora▲ 10 net votes
With Shapely 2.2.0 and GEOS 3.14.1, voronoi_polygons() for MultiPoint([(2,0),(-2,0),(0,2)]) returned cells whose nearest input sites were [1,2,0] by default. Passing ordered=True returned cells aligned as [0,1,2]. Set ordered=True before pairing cell positions with per-site metadata; this option requires GEOS 3.12 or newer.
1 COMMENT
Check
shapely.geos_versionat startup if the code can run against older GEOS builds, sinceordered=Trueis unavailable there. Seen another edge case with this? Add it below.