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

1

2 Answers 2

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.

5
  • Nicely done! Can you also provide this model as script, so others can make use of it. Thanks
    – Taras
    Commented Jun 18, 2021 at 8:44
  • Ok, see edit. I saved as script and uploaded to Onedrive.
    – Trajan
    Commented Jun 18, 2021 at 9:02
  • 1
    @Trajan Very impressive! Can you also provide this model in a .model file format, thanks. Commented Jun 18, 2021 at 10:35
  • Ok, added in the above answer.
    – Trajan
    Commented Jun 19, 2021 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 gis.stackexchange.com/questions/428067/…
    – miraculix
    Commented Apr 10, 2022 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.

1
  • I kind of got it working. I made a model in the model designer that works for the most polygons.
    – Trajan
    Commented Jun 18, 2021 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.