9

I try to follow Programmatically load composer from template and generate atlas using pyQgis to automate atlas print composer using pyqgis :

specific in atlas code say :

    myAtlasMap = myComposition.getComposerMapById(0)
    myAtlas = QgsAtlasComposition(myComposition)
    myAtlas.setCoverageLayer(atlas_desktop)
    myAtlas.setComposerMap(myAtlasMap)
    myAtlas.setFixedScale(True)
    myAtlas.fixedScale()
    myAtlas.setHideCoverage(False)
    myAtlas.setFilterFeatures(True)

this code work for my task and i take new 100 atlas feutures maps but in my template.qpt i have some labels with code like this :

QGIS [%concat( "OBJECTID" )%]

that OBJECTID is the same for all new 100 atlas feutures maps. Any idea why? If I use manual atlas export, then for any map OBJECTID change.


I have more details the true Does not work anything related to layer atlas in my template.qpt i have some base styles rules or base labels rules like this :

intersects($atlasgeometry, $geometry ) 

or

$id = $atlasfeatureid

that is the some in 100 maps :

label

i think so that Programmatically load composer from template and generate atlas using pyQgis just export one by one my features from my atlas layer and the atlas in my template stay False.

any idea ?

1
  • 2
    If you are still interested in solving this problem, please can you post the code you are using to render the atlas? Commented Oct 6, 2017 at 7:37

1 Answer 1

1

Hard to test without a demo.

What happens if you are more explicit in the label so:

QGIS [% concat( attribute(  @atlas_feature , 'OBJECTID'))% ]

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.