The Goal

My goal is to plot archaeological profiles with the QGIS Atlas. Here as an example the plan for the Profile 100.

enter image description here

The way so far

I have detached the profiles from their original positional reference, 'rotated' them (Z value placed on Y-axis) and lined them up one after the other to get elevation data of strata, but also to be able to print the profiles together. The result can be seen in the main map (and the overview map in the upper left corner). As a result, there is a large spatial distance between the original and the 'artificial' position reference of the profiles. The implementation in the atlas is simple.

Problem and Approach

I am having problems with the map Lage in the upper right where I want to show the profile in its original location reference. My approach is to use the spatial distance of the two representations of the profiles. To do this, I wanted to place a point on both the green line representing the profile in plan view and the ortho image of the profile showing the profile in front view. Then merge these two points into a feature. Then bound the map extent of each map to a predefined range. When I select a feature in the preview atlas, the atlas should zoom to the feature, but only if the feature is within the predefined range. This means that the map Lage should than show the profile in plan view (green line) and the main map should show the ortho image of the profile in the front view.

Potential Solution

Therefore I am looking for an expression to do a data defined override for the extents of my layout maps. The boundary for the main map should be between x_min >= 0 and x_max < 1000 because this is the range where the ortho images of the profile are within. The boundary for the map 'Lage' should be between x_min >= 390 000 and x_max < 400 000 (original position reference in UTM 33). I hope to split the search for the feature with the override.

The Question

I have already tried quite a lot, but unfortunately I lack the experience. Does anyone know a solution?

Maybe there would be the possibility to link the map Lage with the line layer (green line in the map Lage) to the atlas? The attribute 'profile number' is present in both the point layer, which I use as coverage layer, and the line layer.

  • 2
    Bit hard to understand what you are trying to do. An example output image might help. Commented Jan 15, 2023 at 23:08
  • 1
    I think you have to write python script to apply your logic.
    – RainForest
    Commented Jan 16, 2023 at 4:59
  • 2
    Please do not edit your question as a different user. It makes more work for those who tasked with reviewing 3rd party edits. If you've lost your original account, you can merge it with the one you've been editing with by reviewing this Q&A
    – Vince
    Commented Jan 16, 2023 at 20:21

1 Answer 1


I solved my problem with the answer of this Question: Atlas zoom on layer outside coverage layer

To show different content in two maps, I aggregated a second layer to the coverage layer of my atlas. The link is the profile number (field 'prof_nr'), which is present in both layers.

The coverage layer of the atlas is a point layer. Page name is the field 'prof_nr'. The main map is controlled by atlas. A point is placed on each ortho image representing the profiles in the front view. The atlas can thus navigate to one profile after the other in the main map.

The second layer shows the profiles in the top view as a green line (map Lage). The map Lage is not controlled by atlas. For the extents of the map I applied a data defined override. When the atlas now calls a feature (profile number) in the point layer, it starts searching for the same value in the second layer and creates a bounding box for the geometry (zooms to the feature).

enter image description here

The expression for x_min

x_min(aggregate(layer:='second_layer_name', aggregate:='collect', expression:=bounds($geometry), filter:="field_of_second_layer"= @atlas_pagename ) )

For the other values of the extents x_min has to be changed (x_max, y_min, y_max)

The result

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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