Hot answers tagged

52

Indeed, you need to use rule-based symbology to achieve what you want. You need to create a rule for what you want to show, and ELSE rule for all others. In the ELSE rule, deselect the symbol checkbox to make it invisible. Hide other features from the coverage layer The rule to show only the current atlas feature can be the following: $id = @...


15

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 tbl_metadata table): Set the tbl_metadata as Coverage layer and select the field with dataset name as Page name. If you want to hide the coverage layer geometry, ...


15

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 attribute manually You should concatenate a row for each attribute, connecting them using pipes: ||. Better use an if-condition: if >0, then show the value, ...


13

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 $id is a function that returns the id of each feature of the current layer. @atlas_featureid is a variable that stores the id of the current atlas feature. ...


11

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 of all of the layers you want that atlas map to show, separated by the | character. For examle: If you wanted to show three fields: "flood_results","...


11

Actually, you already did most of the work required to determine the tiles that you want to print using atlas. But the point is how to adjust everything together to show only the tile IDs that you need. To demonstrate my idea, I will use in this example a DEM image and a grid vector file, as you can see below: First we need to show the label of each grid. ...


11

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 connections. You can then filter this layer using Atlas and don't need to worry about anything else.


11

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 parish boundaries: without filter: With Filter:


10

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, path_field, rc, cc and run. import os from qgis.PyQt.QtGui import QFont ##### MANUAL SETTINGS ##### layout_name = "LAYOUT_NAME" layer_name = "Images&...


10

You can use the following structure: # # previous lines # page_label = QgsLayoutItemLabel(layout) # # other label settings here # text = "[% 'Page: ' + to_string(@atlas_featurenumber ) + '/' + to_string(@atlas_totalfeatures)%]" page_label.setText(text) layout.addLayoutItem(page_label) myAtlas.beginRender() for page in range(myAtlas.count()): ...


9

Try with concat('http://www.example.com/img/',"filename",'.jpg'), replace the .jpg with the appropriate extension if all of your images are the same type. Or concat('http://www.sylve.ch/docs/',"filename") if the extension .jpg or else is included in your name's file.


9

I've finally solved this for my purposes so here's the solution I came up with if it helps anyone: Write a python script (mine at end of this) which essentially does this: identify the unique categories in the point layer field of interest for each category, select all matching points and establish the extent of this set for each extent generate a new ...


9

For your case, that the current layer and the coverage layer don't share a similar field, you will need to use the following rule: within($geometry, @atlas_geometry) Some extras If the current layer and the coverage layer share a similar field, then you can use: "my_filed" = attribute(@atlasfeature, 'atlas_similar_field_name') Finally, if the layer you ...


9

Add a label Set this text: [% @atlas_featurenumber %]


9

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, QgsLayoutExporter import os def export_atlas(qgs_project_path, layout_name, outputs_folder): # Open existing project project = QgsProject.instance() ...


9

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(),'dd.MM.yyyy')%] Note the pipes (||) between the parts of the expression, they are necessary. /edit2: now() gives you the full date, incl. time, which is a ...


9

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 same extend and the atlasfeature is a point feature. Works similar for polygon features with the centroid. with the following expressions for the extents of ...


9

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 value in it's current position in the bottom left (going to call this x1), then drag it into the bottom right and note the new X position (calling this x2). Now, ...


7

For QGIS 2.2, there were made a lot of improvements in the atlas features. On of the new features is that you can now control more than one map with the atlas coverage layer. In QGIS 2.0 the atlas options would automatically choose one of your map items to control. This no longer happens in QGIS 2.2, since you can choose which maps you want to be controlled ...


7

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 [% aggregate('LAYER_NAME','count',"UNIQUE_NON_NULL_ATTRIBUTE_FOR_COUNTING",within($geometry,@atlas_geometry)) %] That will count all the points in your ...


7

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 is no, see this QGIS Project GitHub issue, opened in 2013, still open : https://github.com/qgis/QGIS/issues/17276. Here the old answer where I believed that the ...


7

You could add the main rule $id = $atlasfeatureid, without adding symbols: Then select and drag all the other rules over it (over the label part). They should then become dependent of this first rule:


7

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: Some points: Add a virtual layer using the following SQL - the JOIN matches every point to every other, and the line geometry is generated using the Spatialite ...


7

I have found the solution. Atlas generation TAB Layers B, C and D They need to be rule based (style) and need to contain the following rules (in Style): "Feature ID" = attribute( $atlasfeature , 'Feature ID') - for visible records "Feature ID" <> attribute( $atlasfeature , 'Feature ID') - for all records we don't want to see ( I styled it as ...


7

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 include the name of the first attribute. Eg, this layer would now be called LayerName_Attribute1 Duplicate the layer Layers Panel > right click on the layer ...


7

You assume correctly, that you need to have one feature for each map in thecovrage file. based on your image I would advise you to create a polygon layer, with 5 polygons, which represents the individual areas of interest. This layer would be used as the coverage layer. You can hide this layer so it does not show on the map. If you have a point layer for ...


7

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 each layer -> Labels -> Rendering -> Show Labels Select Data Defined override -> Edit..., and write the following formula: intersects( $geometry ,...


7

Setting those options using PyQGIS requires using QgsLayoutExporter.PdfExportSettings() instance. pdf_settings = QgsLayoutExporter.PdfExportSettings() Then; For "Always export as vector" pdf_settings.forceVectorOutput = True or False. For "Export RDF metadata" pdf_settings.exportMetadata = True or False. "Text export" options: For "Always Export Text as ...


7

Add your attribute table to the layout and than check the box to include only the current atlas object: As an alternative, you could add a text field. You than can introduce fields from the attribute table using the syntax [% "name_of_your_field" %] or you can open the expression editor below and look for the fieldnames there or even format them. ...


7

I know you mentioned you do not code, but your task may be cumbersome in click and drag software, because you want paired images-filenames; your goal may be accomplished with very few (8 to be precise) lines of code, such as the following; you just install R from https://cran.r-project.org/bin/windows/base/R-4.0.3-win.exe ( I guess you are in windows, in ...


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