7

In QGIS, I'd like to use Atlas in the Print composer to generate a series of maps. However, I'd like each map to be printed with "north up". For example, using the classic projection of the United States (shown below), Washington and Maine end up being "tilted" so that north is not "up" on the page (see example).

Is there a setting in QGIS that will sync/rotate the map canvas to "true north" based on the current "zoom"? I know I can create a new field with a "rotation" value and apply that to the properties of the data frame, but I've got too many features to calculate and populate manually.

US States Washington

  • Doing a bit more research, I did find a potential workaround using the "Oriented minimum bounding box" tool in the Processing Toolbox (Ctrl+Alt+T) under QGIS geoalgorithms > Vector general tools. However, it needs a bit of enhancement to get the feature attributes onto the result table so that you can name files based on features. It also doesn't do well for features that are taller than wide. Discussion in comments at Automatic map rotation in map composer QGIS – RyanDalton Jul 31 '17 at 16:41
  • Is there a more efficient way than using the "Oriented minimum bounding box", though? – RyanDalton Jul 31 '17 at 21:07
  • this looks relevant but is for UTM - gis.stackexchange.com/questions/115531/… – Ian Turton Aug 1 '17 at 7:57
  • 1
    Add a layer of meridians. Then set map rotation based on the orientation of the nearest meridian to the center of the atlas feature. – csk Apr 4 '18 at 18:37
  • 1
    Or you could use UTM zones, using the orientation of the longest axis of each zone for the rotation. – csk Apr 4 '18 at 18:42
2

Here is a method I have used, to satisfactory results.

  1. Find the north pole, and copy its coordinates down. The value will depend on the projection you're using.
  2. In your map composer, use the data-defined override on the map's Rotation setting, and enter the following expression:

-degrees( azimuth( centroid( @atlas_geometry ), make_point( pole_x , pole_y )))

Each atlas page should orient toward the pole, or to any point you use for x and y in the expression, for that matter. Below are a few of the outputs from a sample atlas I made to demonstrate this answer. I added a point at the pole for visualization, but it was not required for the process.

output1

output3

output5

  • Good direct solution. This makes use of a data-defined rotation, which is specific to each atlas feature centroid rather than approximating using roundabout ways. – CrystallineEntity Aug 28 '18 at 12:40

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.