4

Update: there's now a better solution to this, see here: QGIS expression to access page-number of atlas for certain features Just an idea for a partial workaround so that you don't have to do everything manually: insert on your atlas sheet an attribute table and list there the names of the towns (no. 1 in the screenshot below).In the feature properties of ...


3

If you would like to avoid having to change a text list for visible layers, why not set up separate map themes with different layer visibility settings and descriptive names (e.g. Bing, Google, ESRI, SISP) You just make visible the layers you want and add that as a theme from the Layers panel. THen set up a data-defined override for map themes on your map ...


2

If I understand your question correctly, it should be fairly straight forward. Assuming you have 3 vector layers that you want to show on all your atlas maps. Lets call them VectorLayer1 (on top of everything), VectorLayer2 (middle) and VectorLayer3 (bottom layer). These layers should be named as such in your layers panel. I think you want to uncheck the ...


2

The feature is available in the current QGIS Master 3.13 and in the forthcoming release of QGIS 3.14: See https://github.com/qgis/QGIS/pull/36131 and https://github.com/qgis/QGIS/pull/36222


1

The part where you were directly stucked should be related to the following newGrid = QgsLayoutItemMapGrid ('My new grid', referenceMap) referenceMap.grids().addGrid(newGrid) You can find below a long correction if you want to use existing grid (if already in your layout) or by adding a new grid project = QgsProject.instance() manager = project....


1

If you use an interval in cm instead of map unit, then the grid will not be rotated


1

You can't use entries from your attribute table for the legend: every entry in the legend stands for a whole layer with (often) many features, each with own attribute-values. Your expression looks like you want to add attribute-values to the legend, which would list all the attribute-values to the legend-item. However, the expression-editor for legend-items ...


1

Look at layout.referenceMap().atlasMargin(QgsLayoutObject.OriginalValue) # Get current value. # You can replace above QgsLayoutObject.OriginalValue with QgsLayoutObject.EvaluatedValue # if using an expression instead of a fixed value layout.referenceMap().setAtlasMargin(yourvalue) # Set current value


1

For the expression, you should use the following if( file_exists(attribute(@atlas_feature, 'pict')), attribute(@atlas_feature, 'pict'), '/tmp/fallback.png' ) For manipulating expressions, you should use from qgis.core import QgsProject, QgsLayoutItemPicture project = QgsProject.instance() manager = project.layoutManager() layout = manager....


1

S field is numeric so value 1 should be reffered as numeric (1). The function would be as follow attribute( get_feature( 'Metro_Ring','S',1),'Route')


1

I managed to find a solution to this, not the prettiest code, but gets the job done: cover_layer_names = ['name1','name2'] # add layer names here for CV in cover_layer_names: cover_layer = QgsProject.instance().mapLayersByName(CV)[0] projectInstance = QgsProject.instance() layoutmanager = projectInstance.layoutManager() layout = ...


1

Update 2: As you can notice, only the actual link (URL) of the blue highlighted text actually works as a link; the text before that ("this is a link") does not. I saved the created QGIS project dummy_atlas together with the polygon-layer as Geopackage for you - than you can try how this works on your computer. Also the pdf-Atlas generated from this project ...


1

A good starting point sample with explanations from qgis.core import QgsProject, QgsLayoutItemMap project = QgsProject.instance() manager = project.layoutManager() layout = manager.layoutByName('yourlayoutname') # Your layout name # Useful if you need to loop on layouts, unused here, just mentioned layouts_list = manager.printLayouts() # If only one map ...


1

The updated recipe for QGIS 3.x from qgis.core import QgsLayoutItemLegend, QgsLegendRenderer, QgsLegendStyle, QgsProject project = QgsProject.instance() manager = project.layoutManager() layout = manager.layoutByName('print1') # Your layout name # If only one legend within the layout layoutItemLegend = [i for i in layout.items() if isinstance(i, ...


Only top voted, non community-wiki answers of a minimum length are eligible