Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add processing algorithms to export a print layout as PDF/image #36916

Merged
merged 5 commits into from
Jun 29, 2020

Conversation

nyalldawson
Copy link
Collaborator

This allows for models which export print layouts from the current project. One
use case for this is allowing users to create an in-project model which exports
a particular set of layouts from the project to certain folders, so that they
can easily re-export the current project in a single operation instead of
having to manually open multiple layouts and export one-by-one.

Additionally, with the new capabilities to have expression based output files
inside models, you can automatically export the layouts to a folder with
the current date tag and include this in the exported file names!

@nyalldawson nyalldawson added Feature Frozen Feature freeze - Do not merge! Processing Relating to QGIS Processing framework or individual Processing algorithms Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks labels Jun 3, 2020
@nyalldawson nyalldawson requested a review from alexbruy June 3, 2020 04:13
@nyalldawson
Copy link
Collaborator Author

(Lots more we could potentially do here: export as GeoPDF, export as SVG, export atlas/report as PDF/image/svg, set print layout map extent, set print layout map scale, ...! )

@nyalldawson nyalldawson added the Merge After Thaw For approved PRs which are ready to be merged as soon as master is thawed label Jun 3, 2020
@roya0045
Copy link
Contributor

roya0045 commented Jun 3, 2020

(Lots more we could potentially do here: export as GeoPDF, export as SVG, export atlas/report as PDF/image/svg, set print layout map extent, set print layout map scale, ...! )

I would assume that data defined variables would still be valid for such exports.

Would it be simpler in the future to have two export functions: export atlas layout and export layout? I would imagine that setting the output in the function would be simpler than having specific dedicated functions.

@nyalldawson
Copy link
Collaborator Author

I would assume that data defined variables would still be valid for such exports.

Correct

Would it be simpler in the future to have two export functions: export atlas layout and export layout? I would imagine that setting the output in the function would be simpler than having specific dedicated functions.

Not really -- the advanced options are very different depending on the output format (svg/pdf/image), so we'd end up needing to expose a ton of options, of which only some apply depending on the format selected. The end result is a confusing set of parameters and poor UX (the grass algorithms suffer from this -- by necessity they expose a ton of different options, some of which are muttually exclusive or interdependant, and making the wrong selection of options results in errors or no output. To avoid this, the native QGIS algorithms have all been designed around the principal of keeping them as "atomic" as possible, and focused on doing one single task)

@nyalldawson nyalldawson added Requires Tests! Waiting on the submitter to add unit tests before eligible for merging and removed Frozen Feature freeze - Do not merge! Merge After Thaw For approved PRs which are ready to be merged as soon as master is thawed labels Jun 19, 2020
…or image

This allows for models which export print layouts from the current project. One
use case for this is allowing users to create an in-project model which exports
a particular set of layouts from the project to certain folders, so that they
can easily re-export the current project in a single operation instead of
having to manually open multiple layouts and export one-by-one.

Additionally, with the new capabilities to have expression based output files
inside models, you can automatically export the layouts to a folder with
the current date tag and include this in the exported file names!
when editing a model which uses the print layout parameter type

Instead of a plain text edit with no hints as to the current project's layouts
@nyalldawson nyalldawson merged commit 2204399 into qgis:master Jun 29, 2020
@nyalldawson nyalldawson deleted the export_alg branch June 29, 2020 01:50
@timlinux timlinux added Changelog Items that are queued to appear in the visual changelog - remove after harvesting ChangelogHarvested This PR description has been harvested in the Changelog already. and removed Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Jul 13, 2020
@roya0045
Copy link
Contributor

@nyalldawson @DelazJ The algs are in the cartography group, but are exclusive to the modeler. Would it make more sense to have them in the modeler group, or have them be available for qgis in general?

@DelazJ
Copy link
Contributor

DelazJ commented Jun 20, 2021

@roya0045 I think you're being misled by the pr message. I never use these algs but I'm pretty sure (no computer around to check) that they can be used directly from the toolbox. Not exclusive to models. So "cartography" section it's.
Also modeler only tools are available only in modeler context.

@roya0045
Copy link
Contributor

@DelazJ Yeah you're right, they are also available in standalone. Doc was fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ChangelogHarvested This PR description has been harvested in the Changelog already. Feature Print Layouts Related to QGIS Print Layouts, Atlas or Reporting frameworks Processing Relating to QGIS Processing framework or individual Processing algorithms Requires Tests! Waiting on the submitter to add unit tests before eligible for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants