For a scientific project I am trying to create a set of PDFs in QGIS with a fix layout (in the print composer) but per PDF a) different map item attributes (extents) and b) a QR-code to identify this PDF. The QR-Codes are already created with a python module (-> .svg) and the extents of the map items are a simple raster. The map content is a WMS which is embedded in the QGIS project.
My idea is to open a pre-defined print composer, iterate through the raster (has simple coordinates) and generate a PDF per iteration with the actual a) map layout and b) QR-code.
I am working with QGIS 2.12.1 (uses Pyton 2.7.5)
-
When you say "iterate through the raster", do you mean pan/zoom to different areas of it in the composer?artwork21– artwork212015年12月03日 12:59:03 +00:00Commented Dec 3, 2015 at 12:59
-
We've done similar bulk print to pdf for the selected features in SurveyingCalculation plugin. It is available in the QGIS plugin repository. See batch plotting.py and batch_plotting_dialog.pyZoltan– Zoltan2015年12月04日 00:18:38 +00:00Commented Dec 4, 2015 at 0:18
-
Right, I mean to pan to different areas. And I will have a look at this plugin, thanks!Marco– Marco2015年12月06日 09:43:03 +00:00Commented Dec 6, 2015 at 9:43
1 Answer 1
Finally I created the PDFs with the atlas plugin in the print composer of QGIS. In the atlas configuration I set my shapefile as covering layer and used a dynamic expression for the filename like
'Map_'|| x_min(@atlas_geometry) || '_' || y_min(@atlas_geometry) || '_' || "SCALE"
The QR-Codes I generated before are shown as an image with an also dynamic expression, in this form
to_string( 'C:\\......\\' || x_min( @atlas_geometry ) || '_'|| y_min( @atlas_geometry ) || '_5000.svg')
for the scale 1:5000. Both worked pretty fine and took its time (about 3 days for the 20'000 maps). Actually my problem is: The printed WMS data (especially the fonts) are too small, the output (PDF or image) doesn't look like the preview in the print composer (see 2 screenshots). I just used the "export to pdf" function without chaning any settings. How can I get the output scaled like in the preview? output preview