2

In QGIS 3.16. I've created an atlas layout based on a polygon layer. There is one page per feature, with various objects in it including maps, labels, html objects, and images for that feature.

What is rendered on the atlas pages comes directly from my layer from the attributes for that feature -- as it should be. But sometimes I'd like to make a change to a page before printing -- just for that one feature, not for others.

The most common example arising in my case is the following:

  • an html object which creates a bullet list based on attribute values for a given field.

Occasionally this list is much too long for the space available on the report page, but I don't really want to change the value in the attribute table (or create a new attribute with an abbreviated version). It would be really useful to have the option to edit the text on the page. In some cases, I would like to add more text than what is there (again, without adding this text to the attribute value in the table).

It seems what I am asking for is a report which, once published, allows data entry and modification in the manner of a form (but without actually changing the attribute values in the table).

6
  • 2
    With this rather general description, it's not possiblw to give but very vague hints and @she_weeds answer does that in a great manner. For more concrete answers, tell us more on how your layout looks, what and how much you want to change and where etc. Like this, you might get more precise answers for your very use case.
    – Babel
    Nov 6, 2021 at 13:29
  • 1
    I’ve tried to focus this to a QGIS GUI question. If you wish to also ask about Python then feel free to as a separate question that includes a code attempt.
    – PolyGeo
    Nov 7, 2021 at 2:27
  • Thanks @Babel and PolyGeo and she_weeds, I have edited the question to be (hopefully) clearer and with one specific example of what I'd like to do.
    – pete
    Nov 7, 2021 at 9:02
  • I'm not sure why you want to avoid changing the attribute table. Of course, you want to preserve the initial values. But you could create another attribute field with a copy of the initial values and fill in there the modified version that is used for the atlas generation. Another approach would be to duplicate the layout and modify there what you want to change.
    – Babel
    Nov 7, 2021 at 13:15
  • 1
    FYI re: changing the attribute table, I already have 100+ fields, many of which are concatenated strings, and I will be leaving the table (and its atlas) for others to use and manage, so adding additional versions of (multiple) existing attributes is likely to be a bit too unwieldy and confusing for the intended users.
    – pete
    Nov 8, 2021 at 9:36

2 Answers 2

4

I don't think there is or really will be a GUI solution for this within QGIS - my understanding is most professional cartographers expect to have to use a vector based graphics software to do custom post-export changes or touchups.

But in some instances you could consider using data-defined override or expressions to change text/display based on atlas page name/number/field value.

For example, if you know map number 5 needs a line break in a specific HTML text box, put in [% CASE WHEN @atlas_pagenumber = 5 then '<br>' else '' END %] and it will produce a line break (<br>) only for map 5.

Could do the same thing for other HTML formatting tags (bold, italics...) or entire layout items like text boxes, lines, symbols, even maps (under Rendering > Opacity).

It can be very clunky though and could require a fair bit of manual work if you have lots of different changes for different pages.

2
  • Thanks @she_weeds. I am considering expressions for certain cases, but I was mainly wondering how to edit things after the fact -- more so text than maps (I've edited my question to this effect). I'm not sure that a vector based graphics solution will help me there, but I wonder if there is an alternative way to export to a program that will allow me to add or modify text?
    – pete
    Nov 7, 2021 at 9:06
  • 2
    If you export your text as paths and export to pdf or svg, I think vector based graphics programs should still be able to let you edit text. I know I've been able to shift text around in a pdf export using Adobe Acrobat... (and very limited text editing)
    – she_weeds
    Nov 7, 2021 at 9:27
3

For dynamically generated text fields, starting with QGIS 3.20, you have the option to click Convert to static text - then you can edit it manually.

From visual changelog:

This option will evaluate and replace any dynamic parts of a label’s contents with their current values.
This provides an easy way to convert dynamic labels to static ones, so that users can manually tweak the results when needed.

enter image description here

2
  • 1
    FYI, I am not sure if this is the intended function or if it is buggy, but once I convert to static text, the label for all* features is converted to the text from the currently displayed* feature. So if Label A (from Field A) for Feature1 = 123, for Feature2 = 234, and for Feature3 = 345, when I convert Label A to static text with Feature1 currently displayed, the label expression will change from [%"FieldA"%] to 123, and will read 123 for all* features as I cycle through the atlas. Still this is a good solution if you only want to print a single page or two.
    – pete
    Nov 8, 2021 at 9:51
  • 1
    You might ask this as a separate question and/or post a feature request (bug report?)
    – Babel
    Nov 8, 2021 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.