Similar to Creating polygons from points using lines as barriers, which has not been resolved; plus, the scenario is slightly different.
I have one dataset with 60,000 points and one with boundaries of ca. 5000 districts. I need to establish areas for the points (using Thiessen). However, the resulting areas must not cross district boundaries.
As a first step, I'd just created the Thiessen polygons. Then I'd make a union with the districts. I could also delete (or dissolve) the residuals that contain no points. (in the example image: black lines)
But: this actually solves nothing. In the example image, the residual of the western district (encircled in blue) would have to be divided up between points A and B. I can't think of any solution to this.


I only changed some variables: pgons = "D:/DTL/Shapefiles/c27_bounding.shp" points = "D:/DTL/Shapefiles/VID_27.shp" insidePoints = "pointsInside" voronois = "D:/DTL/Shapefiles/temp/voronois.shp" outFC = "D:/DTL/Shapefiles/Thiessen27.shp"
– Wernazuma Aug 12 '20 at 13:46