2

I have been using Atlas in QGIS without any Problem. In one Atlas I could "filter" the objects that have to be displayed in the map with a "rule" for color' assignment. this rule combines the @atlas_featureid (current section to be displayed) and the id in that step. If the numbers are the same then the red polygon will be shownd.

enter image description here

However in a report @atlas_featureid doesnt work (or I dont know how to make it work).

Is there any equivalent code for a (let's say) @report_feature_id???

1
  • 1
    Hello, I have made a proposal, if it work for you can mark it as a solution, if not you can give more information to your question i could adapt answer to make it work. May 14, 2021 at 5:29

1 Answer 1

2

For the report you can use @atlas_featureid also.

Sometimes the formula $id = @atlas_featureid don't work well if your layer is not the same ( transformation could alter the id).

A stronger way to show style of one layer depending on the current atlas feature is with @atlas_feature. Add a field in your atlas layer and a field in your target layer (the one you want to style depending on atlas current feature). They must contain same value if you want them to be shown in the rigth atlas page.

Then on your target layer, in the style option use this rule to filter only the feature matching with the layer you want.

attributes(@atlas_feature) ['my_atlas field'] = "my target layer field name"

Note : you have to write the name of your atlas field between simple quotes and your target field name between double. This option could help you to do atlas page that would show multiple feature or feature that are show in different atlas pages.

1
  • 1
    remember also that the name of your atlas field is case sensitive so "Id" is different from "id" (I learned it the hard way)
    – furins
    Aug 18 at 11:09

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.