2

I`m new for the python but want to split Voronoi polygons using points and their directions as input. Voronoi polygons were created by in-built tool: Vector>Geometry Tools>Voronoi Polygons from layer with these fields:

X;Y;ShapeID;LocationID;Azimuth
37.430027;55.518814;5;1;115
37.430027;55.518814;4;1;325
37.430027;55.518814;6;1;235
37.44712;55.535125;3;3;250
37.44712;55.535125;2;3;100
37.44712;55.535125;1;3;355
37.450652;55.520555;9;2;240
37.450652;55.520555;8;2;120

Could someone advise what are the steps to split each polygon into parts with python using location coordinates and azimuths of shapes? I plan those steps:

  1. Merge two layers (Voronoi polygons + shapes).
  2. For each shape draw the lines (start point is LocationID coordinates, end point is intersection with line with direction = Azimuth +/- 360/(2 * shape_quantity_in_location)).
  3. Split each polygon by lines calculated in step 2.

So end points must be calculated precisely to avoid errors. The result should looks like this: Picture

Black lines - Voronoi polygons, Violet lines - shapes azimuths, Green lines - lines from step 2. Black points - locations. I`m stacked with this task. I'm using QGIS 2.14.0-Essen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.