57

When creating a polygon, how do I do it so that the lines are straight (90, 0 degrees, etc.) and when I create corners they can be right angles? For instance, how do I create a perfect square or rectangle?

1
  • 7
    Keep in mind that a "perfect" rectangle will only be perfect within a given coordinate reference system. If you change the CRS, the rectangle will warp.
    – csk
    Commented Oct 30, 2018 at 16:34

8 Answers 8

78

There is a Shape Digitizing toolbar in which has an option to add rectangle using different methods:

enter image description here

To show the toolbar, right-click the main menu and select Shape Digitizing toolbar

I am using QGIS 3.4.

1
  • 8
    This should be marked as solution since it works out of the box, without adding plugins
    – Francois
    Commented Apr 3, 2019 at 8:35
29

No plugin needed

In addition to the Shape Digitizing Toolbar it's also possible to add right angles through the Advanced Digitizing Tools.

Activate the ADT Advanced Digitizing Tools and lock the angles to 90° . Have a look at the documentation of the advanced digitizing tools for what else is possible.

With QGIS 3.14 the last missing bit was added and it is now possible to snap to the currently digitized feature which makes it possible to finalize an object with a right angle. Note the keyboard shortcuts to lock the angle which are shown in the demo video below.

Orthogonal angles demonstration

3
  • Nice answer—thank you! How did you enable the display of the cursor coordinates? Commented Jan 2, 2021 at 0:20
  • It's the rightmost icon in the advanced digitizing tools, available since QGIS 3.14 IIRC Commented Jan 2, 2021 at 7:44
  • This solution answers the requirement from @ahmadhanb, who specificaly asked about creating right-angled corners.
    – geodata
    Commented Apr 20, 2021 at 22:41
22

For QGIS 3: See ahmadhanb's answer.


Original answer:

Check the CadTools plugin. It offers orthogonal line tools. Here's what the help says:

enter image description here

0
9

I tried the suggested solutions but found the CADTools plug-in a bit too complicated to get a quick hang of it. Besides, this is a rather simple task.

Instead I found the plug-in Rectangles Ovals Digitizing by Pavol Kapusta. The name is rather self explanatory and it works excellently. You can draw shapes from centre or by extent.

enter image description here

1
  • I found this plugin to be the easiest set of tools to use in 2.x, but the builtin 3.x tools are great. Commented May 1, 2019 at 1:23
6

the CadTools plugin should do what you want. there is also an tutorial: http://www.catais.org/qgis/cadtools/ (especially look under "orthogonal digitzing")

2
  • The Orthogonal Digitizing tool is still drawing vertexes exactly where I point. My CADTools version is 0.5.9 and QGIS version 1.8. I've tried it with Windows 7, Ubuntu 12.04 and Ubuntu 10.04 now, both with and without OpenLayers Bing Aerial to digitize from. The tutorial site is an excellent resource with a video showing a user clicking the tool, then digitizing a square with perfect 90 degree angles locked in. Could someone else make an attempt to see if it works for them? Sorry it took so long to get back on this.
    – user12711
    Commented Nov 19, 2012 at 0:13
  • 1
    SOLVED: "You have to press the ctrl key to draw lines or polygons with square angles." [ I watched the video but didn't read the instructions. Lesson learned ] Thanks again. The CadTools tutorial link is great
    – user12711
    Commented Nov 19, 2012 at 1:47
5

Another solution is you use the plugin azimuth and distance. http://geotecnologias.wordpress.com/2012/02/03/criando-poligonal-por-azimute-e-distancia-qgis/

2

In order to create polygons or lines with specified lenghts en angles you need to enable the advanced digitizing panel. (View--panels-advanced digitizing)

Just add vector layer (lines or polygons) start editing and add feature. In the advanced editing window you can specify the angles and/or distances. To finish the sketch, click right mouse.

0

I tried the CADtools but I found it a bit complicated. Besides, this is a rather simple task.Instead I found the plug-in Quantum Aided Design(cad like commands in QGIS). The name is rather self explanatory and it works excellently. You can draw/edit/copy/ trim or offset etc..

https://plugins.qgis.org/plugins/qad/

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