November 2018
Beginner to intermediate
272 pages
5h 36m
English
The simplest option for saving the current map is by using the scripting equivalent of Save as Image (under Project). This will export the current map to an image file in the same resolution as the map area in the QGIS application window:
iface.mapCanvas().saveAsImage('D:/temp/simple_export.png')
If we want more control over the size and resolution of the exported image, we need a few more lines of code. The following example shows how we can create our own QgsMapRendererCustomPainterJob object and configure to our own liking using a custom QgsMapSettings for size (width and height), resolution (dpi), map extent, and map layers. Create a new script by clicking on the plus button in the code editor to create a new editor. ...
Read now
Unlock full access