Hot answers tagged

40

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 = @...


8

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.


8

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 ...


8

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","...


8

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. ...


8

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.


8

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 ...


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

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

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

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:


6

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 ...


6

You can try the plugin “Grids for Atlas”. Make sure you list experimental plugins if this doesn't show up at first. Use the plugin to generate a grid, and then generate the atlas again. Make the size of the composer that suits you and the grid will be generated. This is a page size: and this is a frame size:


6

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 ...


6

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 ...


6

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


5

If you uncheck the "controlled by atlas" check box from your map item's properties then the map will keep exactly the same extent and scale for every atlas feature.


5

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 ...


5

You are able to data bind the page size, etc to the current atlas feature like this Create a field on your features with the values "Landscape" or "Portrait" and you should be all good. Be aware this doesn't adjust the items in the layout so you will need to bind item properties for this work correctly.


5

@iant was faster but this is my version with PostGIS. This one works with points and fixed offsets "1" to each direction. select ST_GeomFromText('POLYGON ((' ||ST_X(the_geom)-1||' '||ST_Y(the_geom)-1||',' ||ST_X(the_geom)-1||' '||ST_Y(the_geom)+1||',' ||ST_X(the_geom)+1||' '||ST_Y(the_geom)+1||',' ||ST_X(the_geom)+1||' '||ST_Y(the_geom)-1||',' ||ST_X(...


5

If I understand you correctly, you need to fix the extent of the whole map and highlight only the polygon without zooming. I will based my answer on another creative answer to this question:How to generate multiple maps where one highlighted attribute changes?, but with some modifications that you need to fix the scale and extent of the map view inside the ...


5

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 ...


5

In the Item Properties tab, check the box next to "Exclude item from exports," and click the "data defined override" button next to it. Input this expression: CASE WHEN "field" IS NOT NULL THEN 1 ELSE 0 END Substitute the name of your field where it says "field." Now the image with a null filepath will be excluded when you export the print composer. ...


5

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 the bottom covered by red versions. The label text can then be written as an expression which only shows the red label if the atlas feature attribute has the ...


5

You can't do that! Your grids are landscape (short and wide) but your paper is portrait (tall and narrow). There is no way for QGIS to make them match with out stretching your map in a way that would be very bad for your users. Change your paper layout to landscape and you will get a better match but unless your grid exactly matches the aspect ratio of the ...


4

I solved it at last using 'http://www.example.com/img/'||"filename" However romainbh answer also work! Thanks romainbh


4

You need to create a script counting point within the current atlas geometry. In the expression function editor add this code: from qgis.core import * from qgis.gui import * from qgis.utils import iface @qgsfunction(args="auto", group='Custom') def countPointsInCurrentAltlasFeature(pointLayerName, geomAtlas, feature, parent): # If point geom is empty, ...


4

If you print using the Atlas feature from the Print Composer you can databind a column with the entire file path to a composer image.


4

Insert a scale bar in the normal way, then change the Style drop down to Numeric and you will get a scale as 1:XXXXX


4

It would be easy to replicate this functionality in QGIS using Python, but I don't think it's necessary to achieve what you want. Using QGIS' excellent atlas functionality you can style the atlas feature separately to other features on the layer. On the style tab of your grid layer choose rule-based styling and set a filter for '$id = @atlas_featureid' ...


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