I have developed a workspace that generates around 20 pages of maps and information. It uses the atlas function to control the Layout, so you can select the Site you are interested in, and it generates a "report".

In newer version of QGIS, there is a default action button created when you create an atlas, that lets you click on the Site in the workspace, and Q opens the layout AND selects the chosen site as the atlas feature.

The problem i have is that my workspace takes 5 or more minutes to load, and the layout then takes a futher 5 - 10 minutes to load and render all the pages before i can click "export as a PDF". This is ok for me, as i know to be patient with it and i have a quick machine, but i want to roll this reporting function out to GIS beginners, potentially with slower machines. (The speed itself isnt so much the issue, but more the patience to let it do its thing).

I have a Second workspace, which contains purely background reference information, and my "Sites" layer as is used for the atlas in the first workspace mentioned.

This second workspace is used for generating the site boundaries only. It takes <5 seconds to load.

What i would like to do is to be able to click on the site in the 5 second workspace, and have QGIS Generate a PDF of the 20 page layout from the 12 minute workspace. This seems like it would be achieveable in Python? but im not sure where to start!

Would i need the 5 second workspace to go and open the 12 minute workspace, or could it run the process without fully opening the workspace to the user?

A big step would be to modify or create a version of the "Click to set as Atlas Feature", function that also exports the PDF, and then closes the Layout behind itself, all in the 12 minute workspace. and then as a second half, be able to run this tool from one workspace, but acting on another (closed at initiation) workspace.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.