1

I have 2 pages as part of a multi-page composition in the print composer (QGIS 3.6) and for each page an export condition depending on the attribute value of the feature. This means that based on the attribute value of the feature it is decided whether the feature is printed in a vertical format (page 1) or in a horizontal format (page 2). For all features that are exported with the condition that triggers page 2 to be exported, a suffix with page number "2" is added. The file names of the output images therefore look like this:

feat1_name
feat2_name
feat3_name_2
feat4_name
feat5_name_2
etc

I dont' want a suffix to be addded for all images that are produced with the export condition of page 2. Is there a way to do this with the Atlas function of QGIS3.6?

1 Answer 1

1

Many solutions IMHO. In the layout 'Atlas' tab, edit the output expression formula :

Solution 1 :

attribute(@atlas_feature, 'my_atlas_layer_field_name')

Search the original data in the atlas layer with the attribute function and the variable @atlas_feature.

Solution 2 :

if(substr(@atlas_pagename, -2, 2) = '_2',
substr(@atlas_pagename, 1, length('feat1_name_2') - 2),
@atlas_pagename)

If the variable @atlas_pagename finish with _2, trim it, otherwise, give the whole pagename.

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.