2

We are working on a composer atlas of hundreds of maps showing highway routes, all of which are north-oriented. We would like to be able to rotate these maps to the ideal rotation that maximizes the scale that the route can be displayed. I believe the best way to calculate this would be by looking at the dimensions of the minimum bounding box of the route, compared to the dimensions of the map frame.

For example, suppose that I have a route whose MBB is 300m in the X dimension and 100m in the Y dimension (3:1 ratio). In comparison, the ratio of the map frame is 2:3 (taller than wider). Is there a way to calculate the angle that the map needs to be rotated away from north so that the MBB of the route at this rotation becomes 2:3, which should maximize the scale that it can be displayed?

underdark
  • 84,148
  • 21
  • 231
  • 413
  • 1
    this is related to https://gis.stackexchange.com/questions/250530/how-to-rotate-qgis-composer-map-frame-to-north-when-using-atlas – Ian Turton Aug 25 '17 at 14:43
  • Related, but different. Now knowing that a value can be included in a field to rotate the map automatically, I believe it's become more of a math problem about how to calculate this rotation. – Ronald Halliday Aug 25 '17 at 17:38

0 Answers0