I draw a rectangle vector (shape digitizing, add rectangle). Now I want to rotate it (rotate feature). During the rotation it looks like I want it: with right-angled corners. Then it is distorted like a parallelogram.

enter image description here

How can I prevent this?

I did not try the new expression. I prefer visual editing and not typing commands.

It's WGS84, maybe 30x20 meter, Germany/Berlin.

In OSM editor drawing buildings is so easy: draw something complex with near rectangles and then say "rectify".

  • 7
    What projection do you use? How large is the area covered by the rectangle? In which area of the world is it placed? – Babel Apr 26 '20 at 9:35
  • 1
    There's a new expression in QGIS 3.12. for rotating geometries, did your try it? qgis.org/en/site/forusers/visualchangelog312/… – Babel Apr 26 '20 at 15:32

I assume you're using EPSG:4326 (WGS84). The problem is this projection greatly distorts shapes as you get farther from the Equator, since it displays one "vertical" degree with the same number of pixels as one "horizontal" degree.

Here is the comparison between EPSG:4326 (WGS84) and EPSG:3857 (Web-Mercator) for displaying Germany:

EPSG:4326 EPSG 4326

EPSG:3857 EPSG 3857

However, it appears that your Vector Layer CRS is not EPSG:4326 (Which is fine, if you want to use it to create buildings, you probably want to use a suitable projected CRS, like LCC Germany (EPSG:5243), or at least pseudo mercator (EPSG:3857)).

The QGIS rotation tool performs the rotation in the layer's coordinate reference system, so while the rectangles appear distorted after rotation, they are still rectangles, which you will see if you switch the project CRS from EPSG:4326 to EPSG:5243. The actual flaw of the tool is the preview does not correctly handles different projections between project and layers.

Step 1: Rectangle creation

  • Project CRS: EPSG:4326
  • Layer CRS: EPSG:5243

enter image description here

The rectangle is created. One try to rotate it. Note that the rotation preview is WRONG

Step 2: Rotation

  • Project CRS: EPSG:4326
  • Layer CRS: EPSG:5243

enter image description here

After the rotation, the rectangle appears distorted.

Step 3: Change CRS

  • Project CRS: EPSG:5243
  • Layer CRS: EPSG:5243

enter image description here

After switching back to a projected coordinate reference system, one can see that is was still a rectangle all along.

Note that if your vector layer's CRS was EPSG:4326, it would be the other way around: it would look just fine as long as you were displaying your map with EPSG:4326, but the buildings would REALLY be distorted (which you would realize when switching your project CRS to a projected CRS).

In conclusion, you MUST use a projected CRS for your vector layers, otherwise, after rotation, your buildings will ACTUALLY be distorted. And you SHOULD use a projected CRS for the project, or Pseudo Mercator.

QGIS provides a tool to draw oblique rectangles (in the Shape Digitizing Toolbar, click on the down arrow next to the Rectangle tool).

Oblique rectangle

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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