I work on trails and frequently need a series of maps that follow the trail. I've been able to create an Atlas, but I'm struggling to get each map to rotate with the trail.
Here's my current process:
- Create a layer where I define the segments that I want (in this case, I called it AtlasMapViewLines)
- Draw line segments for each view that I want (I've read about the options for automating this, but in our case I actually want to control what each map covers, so I'm fine drawing each segment)
- Create a new attribute (in this case called Main_Angle) with the field calculator to calculate the angle of each line using the following forumla: main_angle($geometry)
- Create a new layout & generate an Atlas using the AtlasMapViewLines layer that I created.
So far, so good -- this generates an Atlas of each segment that I've defined. At this point, all the maps are north up and scaled to fit. The problem comes when I try to get them to rotate. Here's my next step:
- In Item Properties, Map rotation, I click on Data Defined Override > Field Type ... > and select the Main_Angle attribute.
The maps all rotate, but not in a way that I want. Firstly, the segment is not horizontal, as I'd like. Secondly, north is now down!
Here's a screenshot -- the purple lines are the segment lines that I'm using to define the Atlas. The orange and blue arrows are just visual markers for me to see the end of the lines.