3

I have a polygon layer. Each polygon is part of a street, so it's not straight or all the same orientation. Each single polygon has an attribute with a number.

I would like to divide the polygons in equal parts (same area, or even better: same length of longest side). The number of parts is an attribute. So for instance, some polygons should be divided by 1 (so they stay the same), some in 2 parts, some in 10 parts, etc.

This parting should always be in the 'long' side: The street should be divided length-wise. Is this possible?

Example input: enter image description here

Example output: enter image description here

Taras
  • 32,823
  • 4
  • 66
  • 137
Trajan
  • 71
  • 1
  • 6
  • Could be useful: [1] https://gis.stackexchange.com/questions/321021/how-to-split-polygon-into-equal-area-polygons-in-qgis-3 [2] https://gis.stackexchange.com/questions/201100/how-to-split-polygon-into-equal-segments-in-qgis – Taras Jun 17 '21 at 07:14

2 Answers2

2

It's possible to make a model to do this with a single press of a button. I made it myself. It's quite difficult with a lot of steps, but check the following printscreens:

Model: enter image description here

Origin shape: enter image description here

Export shape: enter image description here

Edit: The model for download, link below: https://trajan-my.sharepoint.com/:u:/g/personal/ruben_trajan_nl/EZmV6W6dTe9Dt0FHzZSITwwBdPJ-BpUqtwuI_Ls6YkUalw?e=ElC6vD

I also saved the model as Script. Download link below: https://trajan-my.sharepoint.com/:u:/g/personal/ruben_trajan_nl/EVo9WxDuFLdIpY-_NN6MrhUBuY2LT_2JiAcTnaB2El_Weg?e=p9RdoW There are a couple of places where you probably would need to make changes.

  • For example the fields that are necessary right now are 'ID' and 'Capaciteit'.
  • The length of the vertices (so the max width of the polygons) is currently set to 12 meters, so 6 meters to each side from the center.
  • The percentage overlap between the polygon and the bounding box need to be more than 50% currently. I have tested with multiple variations.

This can all be changed.

Trajan
  • 71
  • 1
  • 6
  • Nicely done! Can you also provide this model as script, so others can make use of it. Thanks – Taras Jun 18 '21 at 08:44
  • Ok, see edit. I saved as script and uploaded to Onedrive. – Trajan Jun 18 '21 at 09:02
  • 1
    @Trajan Very impressive! Can you also provide this model in a .model file format, thanks. – Kapildev adhikari Jun 18 '21 at 10:35
  • Ok, added in the above answer. – Trajan Jun 19 '21 at 19:02
  • Hey. does it work to divide an area into only two? Not sure if you use the "Voronoi - Polygone" cause it requires at leadt tree points and I just have two in my case https://gis.stackexchange.com/questions/428067/dividing-a-polygon-into-only-two-equal-areas-in-qgis – miraculix Apr 10 '22 at 17:25
0

I would also like to know the answer for your precise question. But there exists a Plugin that you can divide bottom-down or left-right, it is called Polygon Divider. But it your case it does not help fully.

Taras
  • 32,823
  • 4
  • 66
  • 137
  • I kind of got it working. I made a model in the model designer that works for the most polygons. – Trajan Jun 18 '21 at 08:35