17
votes
Accepted
Filtering layers in QGIS atlas
You can use the tbl_metadata file as coverage layer in Atlas. Then use rule-based symbology with @layer_name = @atlas_pagename.
I assume that your data looks like this (the attribute table is ...
15
votes
Accepted
Displaying only attributes not zero in QGIS Atlas text box
Manual version
With this option, you manually add a row for each attribute, reusing the same expression. See below how to automatize this for all fieldnames at once.
Create a condition for each ...
14
votes
QGIS Atlas turning on/off raster layers
I've just done this with 84 different raster layers.
The method i used was:
Create an atlas polygons layer with 84 features in it.
Create a text field in the atlas polygons layer and write the names ...
14
votes
Show only features within current Atlas feature
If as @Underdark suggests you set a rule based style using a filter like:
intersects( $geometry , @atlas_geometry )
You will get the effect that you want, though some of my buildings cross the ...
13
votes
Accepted
Styling currently used feature of Coverage layer of Atlas
You don't need to consider the page name or number. Since the layer you are trying to dynamically style is the same as the coverage layer, you can use the following expression:
$id = @atlas_featureid
...
11
votes
Determining neighbouring tile ids in QGIS
You already did most of the work required to determine the tiles that you want to print using an atlas. But the point is how to adjust everything together to show only the tile IDs that you need. To ...
11
votes
Accepted
Seeking QGIS geometry generator manual?
There is no such site so far. The feature is rather new and usage examples are only starting to emerge now.
For your specific use case, I'd still recommend to create a line layer with all ...
11
votes
Export a configured Atlas with a Python script / command line?
In QGIS 3.4 (maybe 3.x in general), exporting atlas seems much more straight forward than before (at least from looking the available answers).
from qgis.core import QgsApplication, QgsProject, ...
11
votes
Adding site photos to a print composer atlas in QGIS
It looks like so hard without any script. So I tried a solution like below.
Sample data:
margin and interval
Script:
Copy/paste the script to QGIS Python Editor. Set layout_name, layer_name, ...
11
votes
Accepted
Move inset map in QGIS based on defined anchor point
I had this problem before. The only way I found to do it was to write a IF expression for the inlay map's X position (item properties > position and size > X).
Make a note of the inlay map's X ...
10
votes
Automatically Show the Page Number of Atlas QGIS
Add a label
Set this text:
[% @atlas_featurenumber %]
10
votes
Accepted
Adding page number to an atlas layout with PyQGIS 3
You can use the following structure:
#
# previous lines
#
page_label = QgsLayoutItemLabel(layout)
#
# other label settings here
#
text = "[% 'Page: ' + to_string(@atlas_featurenumber ) + '/' +...
9
votes
Seeking QGIS geometry generator manual?
This is possible using a different 'geometry generator' to the one that you originally intended I suspect, You can avoid having to generate the all connections line layer by using a virtual layer:
...
9
votes
Adding date to label in QGIS Atlas composer?
Just tried it out, for me (QGis 2.18) format_date(now(),'dd.MM.yyyy') works.
/edit: You need to put the [% %] around your whole expression, then it should work, like: [%'Datum: ' || format_date(now(),...
9
votes
Accepted
Varying page size of maps within an Atlas in QGIS?
In the Page properties of the layout (Right click the map) you can set the Orientation using an expression.
if( bounds_height( @atlas_geometry )> bounds_width(@atlas_geometry ) , 'portrait', '...
9
votes
How to turn off QGIS legend band number by default?
Just stumbled on this problem myself... Found a (slightly hacky) solution.
Double click on the text that says "Band 1" in the Legend Items box of the layout. replace this text with a space i....
9
votes
Using two different maps on one atlas page
Yes you can do this with the expression string builder overriding the extent of the second map regarding the extent of the first map which is controlled by the atlas. Supposing your two maps have the ...
9
votes
Accepted
Automatically export each item in a layer as an image
According to the ideas posted here I suggest you to follow these steps:
Create a non-geometry layer with the names of your categories. For example, a virtual layer with SELECT DISTINCT (...
9
votes
Accepted
Generate cover layer for atlas
Algorithmic approach
Define a fixed width x and hight y for the rectangles (grid cells). Split your polygon in horizontal slices (bands, belts) at the interval of y (red outlined in screenshot).
Get ...
9
votes
Accepted
"Show single Polygon" Atlas Filter Expression
you can use a ruled based layer-styling with the following rule:
$id = @atlas_featureid
which will show in the atlas only the current atlas feature, all others will be invisible. Be aware that in ...
8
votes
Map Atlas switching orientation in QGIS
I used a if expression instead of building a virtual column
if(bounds_height( @atlas_geometry ) > bounds_width( @atlas_geometry )
,'portrait','landscape')
this can be used to configure x ...
8
votes
Accepted
Automating Atlas to create maps for all Attributes
Step 1: Categorize your original shapefile
Stylize your original shapefile with graduated categories based on the first of your 50 attributes.
Rename the layer (NOT the original shapefile) to ...
8
votes
Accepted
Custom label color in QGIS atlas
Since the font color of labels in print composer in QGIS 2.18 can not be data-defined, a workaround is needed. One possible approach is to duplicate the the "N" and "S" labels with black versions on ...
8
votes
Filtering out labels surrounding active feature in Atlas
To hide the labels outside the atlas geometry boundary, you need to do the following:
Right-click the layers that their labels are shown outside the atlas
geometry boundary
Go to Layer properties for ...
8
votes
Accepted
Setting options in "PDF Export Options" to export an atlas to PDF using PyQGIS
Setting those options using PyQGIS requires using QgsLayoutExporter.PdfExportSettings() instance.
pdf_settings = QgsLayoutExporter.PdfExportSettings()
Then;
For "Always export as vector"
...
8
votes
Accepted
Access report/atlas page from feature in layer (QGIS)
The identify tool could do what you expect in possibility number 1. It could open the atlas page you click on.
Step by step :
Select the layer used as coverage layer
Click on the identify tool
Right-...
8
votes
Accepted
QGIS filter Atlas with intersecting geometries
For my understanding, you want to apply a filter to your atlas layer based on other layer geometry.
In the layout control panel, you can set a filter applied on your atlas layer to get atlas produced ...
8
votes
Accepted
Atlas - Export only certain pages
Option 1
Click Atlas --> Atlas Settings
Here, you have chosen which layer composes the atlas.
You can add a filter setting by expression. Put something like 'name' LIKE "feature3" OR '...
7
votes
Accepted
How to count points within the current Print composer atlas feature in QGIS 2.8?
This works for me: use the aggregate() expression in a text label, with within($geometry,@atlas_geometry) as a filter for points within your atlas feature.
The full syntax in your text label would be ...
7
votes
Setting data-driven symbol levels in QGIS
The answer is Yes No.
EDIT
As @Babel pointed it out to me, Symbol levels are a vector layer symbology option to choose the order of symbol layers, see here the official documentation.
So the answer ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
atlas × 501qgis × 430
print-composer × 145
expression × 38
qgis-3 × 37
pyqgis × 35
layouts × 22
labeling × 19
python × 17
filter × 17
scale × 17
atlas-generator × 17
printing × 14
export × 13
legend × 13
attribute-table × 11
mapping × 11
qgis-2 × 10
layers × 9
pdf × 9
rule-based × 9
extents × 8
reports × 7
raster × 6
shapefile × 6