I'm working on a project using QGIS and there is a process that I'd like to try to automate. I'm working with the "rectangles,ovals digitizing tool" plug-in to make perfect rectangles. The next step in my process is to split these rectangles horizontally and vertically in equal intervals in order to make many smaller equal-area rectangles as shown in the picture below.

splitting rectangles

I am currently using a help line layer and the plug-in "qchainage" to split the lines equally across each side of the rectangle. Then I use snapping to cut the polygon where the vertices's were created. This process isn't bad, but it's getting too slow and opens a door for manual mistakes.

I'd like to find or develop a plug-in or a script, where I can input a selected rectangle, an integer m for the number of parts I want to split the short side to and another integer n for the number of parts I want to split the long side to. In the example above - m = 2 , n = 5 .

I've tried to learn from this discussion, but didn't find what I was looking for. I've written a few scripts using pyqgis so if anyone has a suggestion I can try to implement it.

  • 1
    If you can write scripts, why not just write one that solves your problem? It's not very hard to figure out where to draw the horizontal and vertical lines once you know your m and n. Just some bookkeeping to collect the proper corner coordinates for each smaller rectangle. What part of that problem do you need help with?
    – Jon
    Commented Aug 22, 2018 at 14:55

1 Answer 1


You could try using the Polygon Divider plugin which allows you to divide your polygons to a specified size. You can download this from the menubar:

Plugins > Manage and Install Plugins


  1. A rectangle with an area ~100,000 m2:


  2. Executing the plugin to create 'parts', each with an area of 10,000 m2:


You could also check the source code for the plugin to see how it's done and use the code for your own scripts or modify the plugin itself.

  • And for QGIS 3 ?
    – juko
    Commented Dec 20, 2019 at 10:00
  • @Jürgen - Unfortunately this plugin doesn't seem to be available for QGIS 3 yet.
    – Joseph
    Commented Dec 20, 2019 at 12:12
  • Do you know maybe a possibilty with for example Grass tool für qgis?
    – juko
    Commented Dec 20, 2019 at 12:16
  • @Jürgen - Not that I am aware of. If you want to randomly divide your polygon, you could use the method described in this post. Otherwise I would suggest installing QGIS 2.18 (which can be installed alongside QGIS 3) and use the plugin on the shapefile. Then continue using the output in QGIS 3.
    – Joseph
    Commented Dec 20, 2019 at 12:22
  • 1
    Thank you for your suggestions. In this case I think I can solve it with a mixture of snapping options and advanced digitizing tools. Not to split polygons, but to create polygons with the same rotation and the same width. The result is OK.
    – juko
    Commented Dec 20, 2019 at 18:15

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.