Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

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

Is there any python function allowing a user to rotate map layers in the map canvas. If so, could you please point this out for me?

I want to rotate a map layer, using a factor of rotation in degrees, into the map canvas so as to better fit and display all map elements in the layout. I tried using qgsAffine but I didn't succeed.

Thank for your help.

share|improve this question
Do you really wanna rotate a layer (e.g. change the geographical position) or do you just wanna rotate it for the final layout (in the print composer). If its the latter then have a look at the Advanced --> Rotation Field options – Curlew Sep 21 '13 at 15:11

type in "python console" >>>canvas.rotate(x). "x" is the number, in degrees, of how much you want to rotate the canvas. The canvas will rotate, but I think it's not what you want.

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.