Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some polygon-shapes in qgis-1.7.0 and want to ensure that every polygon is a rectangle. See image below.

enter image description here

Is there any way I can do this in QGIS (or any other f/oss)? Or how can I improve my polygon-drawing to make sure for example that every building consists of rectangles (all angels = 90°)?

Any hints appreciated! Thanks!

share|improve this question
Ignore my close flag. It is a different question. – Nathan W Dec 28 '12 at 11:54
In theory it should be pretty easy to write something to do this. Loop each point in the odd shape, checking the angle to the next point from the current one if it's not 90 then calculate the new point and adjust the point. Now someone just needs to write the code :) – Nathan W Dec 28 '12 at 13:17
read this answer for orthogonal digitizing. – Aragon Dec 28 '12 at 14:02
@Nathan It's nowhere as easy as that in general, because each time you change a vertex location you create distortions elsewhere. Even when fixing near-rectangles (as opposed to more complicated polygons) you can wind up producing new features that are clearly not very good approximations to the original ones. One problem is that there is not a unique way to calculate a new point at a bad vertex. See for a discussion and pseudocode. I tested that approach (using Excel, of all things!) and found that it tends to work well. – whuber Dec 28 '12 at 16:23
@Under I cannot find it either. A closely related one (where I wrote a comment, not an answer) is Finding Polygons Without Right Angles. In my search I also uncovered How to Create Polygons with Straight Lines and Right Angles in QGIS as well as a duplicate (which I have just closed and merged). – whuber Dec 31 '12 at 14:26

You can fix it with bounding box area of all polygons. The name of function is Polygon from layer extent.

enter image description here

Select your layer and mark the option calculate extent for each feature separately:

enter image description here

All original polygons are present in the same layer, not separately. QGIS will calculate the bounding box area for all entities:

enter image description here

QGIS Rocks! Hugs from Brazil!

Jorge Santos

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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