61

In QGIS 3.x you have to right click on the page in your layout to find "Page Properties".


15

It's sort of hidden, but still there. In QGIS 3.0, you can now have multiple pages in a single composer screen, and each page can be adjusted on its own. The pages are hidden from the Items panel, but all you need to do is right-click on any page and select Page properties. The settings you're used to seeing will pop into the Item properties tab:


6

You need to scroll down just a little bit more to find Grids options. Then the difference from the linked tutorial are: Click on Modify grid... to call up Appearance properties. Set CRS for the Grid in this Appearance menu.


6

you can make your own expression for that with the function editor: and then use the new expression in the layout: with the following code: from qgis.core import * from qgis.gui import * @qgsfunction(args='auto', group='Custom') def layoutid(layoutname, feature, parent): """ Returns a unique layout id. <h2>Example usage:</h2> &...


5

I set font-size in a surrounding span when font size alone didn't do the trick <span style="background-color:%s; padding: 5px; font-size: %spx;"> <font face="%s" color="%s">%s</font> </span> https://github.com/anitagraser/TimeManager/commit/75fae61da07ab5c7867287706751d476a6502851


5

It is possible in QGIS 3.0 After you add pages, R-click on the page to edit its properties. Select page size that you want. Note, this function may change to a different menu in 3.2


5

You can simplify this script considerably in QGIS 3.0: projectInstance= QgsProject.instance() projectLayoutManager = projectInstance.layoutManager() image_settings = exporter.ImageExportSettings() image_settings.dpi = 300 # or whatever you want for comp in projectLayoutManager.printLayouts(): if comp.atlas().enabled(): result, error = ...


5

You can use Add a new arrow to layout which is a graphic path and select None for End marker: The result is this: Or you can also use Add node item and select polyline to add polyline directly: Here is the output: For adding points, I agree with @jberrio in his comment, there is no specific tool to do that. But for my understanding it might not be so ...


5

The values are in the QGIS3.ini and under QGIS, in the properties > Advanced tab > core > Layout > searchPathsForTemplates. I modify the values with the following code : new_template_dir = "/home/me/my_custom_template_dir" app = QgsApplication.instance() params = QgsSettings( app.qgisSettingsDirPath() + "QGIS/QGIS3.ini", QSettings.IniFormat ) params....


4

This a basic example how export to pdf where you can espify the layout. projectInstance = QgsProject.instance() layoutmanager = projectInstance.layoutManager() layout = layoutmanager.layoutByName("test") #Layout name exporter = QgsLayoutExporter(layout) exporter.exportToPdf("C://test.pdf", QgsLayoutExporter.PdfExportSettings() )


4

You will also need to include PdfExportSettings() when using the exportToPdf() method. You can call the default values using QgsLayoutExporter.PdfExportSettings(). So your code could look like: QgsLayoutExporter(layout).exportToPdf( filepath, QgsLayoutExporter.PdfExportSettings() )


4

With your code, you are creating a new instance of QgsLayoutManager. So, you don't get current list but an empty one. You should retrieve the project instance with projectInstance = QgsProject.instance() From it, you can get the current layoutManager instance and deduce the layouts projectLayoutManager = projectInstance.layoutManager() ...


4

You need to link the legend item to a map item in your layout which is an instance of the QgsLayoutItemMap class. So if you have done something like: map = QgsLayoutItemMap(layout) layout.addItem(map) link it with the legend before enabling the filtering: legend.setLinkedMap(map) # pass a QgsLayoutItemMap object legend.setLegendFilterByMapEnabled(True) ...


4

..I got it! I use this expression for a composer item label with 'insert expression': aggregate(layer:='Corridors_86ef2ea9_d1a1_4d9f_9735_7b7b2fb54cb2', aggregate:='concatenate', expression:="Name", filter:=within($geometry, map_get( item_variables('Main Map'), 'map_extent')), concatenator:=', ') Works like a charm:)


3

Based on @Gabriel De Luca being able to reproduce the PDF without my same issues, I had hope that I was doing something wrong on my end. My original QGIS Print Layout would only create a 1 mile scale bar that was 360 px at 300 DPI, when it should be 300 px for the intended scale of 1:63360 (1 in = 1 mile). I created a new QGIS Print Layout, with ...


3

If the values are included in your layer: you can call them in the printcomposer by going to tab 'Atlas generation'. In the section 'Output' you can define the outputname. In your example it would be: "Projectcode" ||'_' || "Title" || '_' || day(now())|| '-' || month(now()) || '-' || year(now()) Which gives the result Projectcode_Title_15-01-2019 You ...


3

Use the following expressions. They are based on regular expressions, so will be nice and tolerant of slight differences in format: For Drawing Number: regexp_substr(@project_filename,'(.*?)R') For Revision Number regexp_substr(@project_filename,'.*?R\\s*(.*?)\\s*-') Title: regexp_substr(@project_filename,'-\\s*(.*)\\.')


3

Great, it's gone! thank ndawson. My new code write atlas result in subdirectories, if can help anyone import os folder = "D:\CARTE_THEMATIQUE\OUTPUT" projectInstance= QgsProject.instance() projectLayoutManager = projectInstance.layoutManager() for comp in projectLayoutManager.printLayouts(): comp.atlas().setFilenameExpression( "CODE_CENTRE ||'/'|| ...


3

The best I can come up with is [% @layout_numpages * @atlas_featurenumber + @layout_page - @layout_numpages %] which seems to work for 2 & 3 page layouts. Code explanation : @layout_numpages * @atlas_featurenumber : gives the last page number for the feature (e.g. : with 4 pages at the 5th feature, the last page will be 20) ; @layout_page - @...


3

You have two options: Option 1: Apply the following expression on the Position and Size of the photo frame. You can apply it only on X position if you want as follows: Case when @atlas_featureid in (200,250) then 320 end Where the 200 and 250 are just examples of the feature ids that do not have photos and the 320 is a value to place the frame outside ...


3

Create your atlas with your Point Of Interest layer as coverage layer. For each of the two maps, make them controlled by the atlas and fix their scales. If you want different scales from one POI to another, create two integer fields in the coverage layer for each map scale. You can define after the scale of each map in the control by attribute dropdown by : ...


3

In the item properties of your map in the print composer scroll down to the Grids section. Select your grid and press the Modify Grid.... Now scroll down to Draw Coordinates. The Format dropdown menu allows you to select the display format of the coorinates of your grid. From the dropdown select any item that includes with suffix to print the Northing/...


3

It's for sure possible. In QGIS you can define various 'Map Themes' (i.e. give a name to a certain layer visibllity setting, in your case "with basemap" or "without basemap"): Then in Print Composer you can select one of your map themes (visiblitities) in each maps properties: That way you can have different layer settings in each map (overview etc.)


2

Seems like a bug, you should submit a bug report. A possible workaround could be to change the rendering settings of the map from the Item Properties section. For a fairly simple map such as the one you have shown, you could try Darken mode. You will be prompted if you want to export the pdf as raster or vector. I used a simple example, not sure if the ...


2

Finally figured it out. I didn't realise that although I had selected show all labels, 'scale dependent visibility' was selected and as a result, my labels were not visible in layout. After unselecting and refreshing the view, the country names appeared.


2

Style are based on pixels (the screen unit). They are not related to resolution (related to scale). If you want to tie width with scale on the map, you should use a function instead as it can access resolution var layerWFS = new ol.layer.Vector({ source: sourceWFS, title: 'plot_layer', name: 'plot_layer', style: function(feature, resolution) ...


2

There is an expression variable @layout_name which contains the name of the current layout.


2

I think this function will work (for QGIS version >= 3.0) : def rmvLyr(lyrname): qinst = QgsProject.instance() qinst.removeMapLayer(qinst.mapLayersByName(lyrname)[0].id()) Call it by : for lyr in ['Patient Data', 'Google Maps']: rmvLyr(lyr)


2

You can try this: for lyr in QgsMapLayerRegistry.instance().mapLayers().values(): if lyr.name() == "Patient Data": QgsMapLayerRegistry.instance().removeMapLayers([lyr.id()])


2

go with your mouse to the layout page und press the right mouse-button. then you can change the page properties


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