qgis / QGIS-Enhancement-Proposals

QEP's (QGIS Enhancement Proposals) are used in the process of creating and discussing new enhancements for QGIS
117 stars 37 forks source link

Map Theme Manager #211

Open roya0045 opened 3 years ago

roya0045 commented 3 years ago

QGIS Enhancement: Map Theme Manager (Panel)

Date 2021/03/02

Author @roya0045

maintainer @roya0045

Version QGIS 3.20/3.22/?

Summary/Proposed Solution

Changing themes in the current way becomes unweildy when a project has a lot of layers and/or themes. Doing some change requires more click and errors are harder to spot.

To this effect I propose the addition of a dedicated panel that would allow to visualise the content of each theme, browse them (list selection widget and maybe arrow?) and easily remove and add layers ( add button and remove button, possibly drag and drop).

Preliminary work: image

I still need to consider how to handle layers with multiple symbology, suggestions are welcome to easily manage this.

My Section

UI & QgsMapThemeManager

Example(s)

None for now

Affected Files

(required if applicable)

Performance Implications

(required if known at design time)

Further Considerations/Improvements

(optional)

Backwards Compatibility

(required)

Issue Tracking ID(s)

(optional)

Votes

(required)

roya0045 commented 3 years ago

I'm not sure if this was worth to make as a QEP, I can close if the existing feature request is sufficient.

rduivenvoorde commented 3 years ago

I've never understood what a 'theme' is and why I would start using in (in what kind of environments/datasets). Maybe it's just me, but can you maybe define 'theme' and add some examples in which they are really useful?

andreasneumann commented 3 years ago

I've never understood what a 'theme' is and why I would start using in (in what kind of environments/datasets). Maybe it's just me, but can you maybe define 'theme' and add some examples in which they are really useful?

Themes are basically "bookmarks" to combinations of:

If you have a complex project and would like to generate different map products with a different layer visibility and style combination you can quickly exchange these products with themes.

Themes are useful in the map production (layout section of QGIS). You can assign different themes to different layouts and map frames. And different themes for overview/reference maps - because they usually have a totally different map scale. They are also useful for assigning different map themes to different map canvas views, in case you have more than one map canvas open in your main QGIS window.

roya0045 commented 3 years ago

And too provide more details as to what Mr. Neumann said, themes are exceedingly important when producing multiple thematic maps in batches.

I have some projects where I need 10+ themes to properly display all the data and report it adequately. Using a theme and controlling them through the atlas variables is critical. This way I can change the layer styles, do some tweaks and quickly export the tens of modified map from a single layout.

Though themes are currently annoying to manage, validate and change, hence this QEP.

andreasneumann commented 3 years ago

A friend of mine also suggested to enhance "themes" with a reference to the "layer order" (control of the separate layer order panel). I think this should also be considered in a future "theme manager".

This is not possible today, but we are now discussing/considering to add this functionality to "themes".

roya0045 commented 3 years ago

@andreasneumann It depends how we want to do this. I don't think I can come up with an efficient way to do this... But I could see why. This would be more involved as I plan to simply use the existing layertreemodel with the qgsthemecollection to filter out or simply display needed 'nodes' and control the collection from there.

Reordering would mean more involved changes instead of only affecting the themes themselves, at least for this QEP.

haubourg commented 3 years ago

Hi all, just a side note on the vocabulary here.

We had previously the term "map preset" and now have "map theme".

In fact, this is is somehow related to what the OGC defines as a "map Context", which even has its standard WMC. Web map context is a broader definition, more of the scop of a whole project file, but still I like the naming and we could maybe use it in tooltips to clarify what a theme is.

"Themes" remind me of ArcView 3.2 and Mapinfo. Good old memories (or not) , but it reflects the fact that "theme" as no real semantic. Map Context is still a large concept, but a little bit more specific.

Bye all Régis

Le mer. 3 mars 2021 à 14:27, Alex notifications@github.com a écrit :

@andreasneumann https://github.com/andreasneumann It depends how we want to do this. I don't think I can come up with an efficient way to do this... But I could see why. This would be more involved as I plan to simply use the existing layertreemodel with the qgsthemecollection to filter out or simply display needed 'nodes' and control the collection from there.

Reordering would mean more involved changes instead of only affecting the themes themselves, at least for this QEP.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/qgis/QGIS-Enhancement-Proposals/issues/211#issuecomment-789713365, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMN5HK7WEUMYPYDJFBT4FTTBY2NXANCNFSM4YRBDRZQ .

andreasneumann commented 3 years ago

I don't think I can come up with an efficient way to do this...

@roya0045 - I don't expect your to do this. I just wanted to add a bit of information on the context of map themes - and that the layer order might be part of a future "map theme" bookmark.

andreasneumann commented 3 years ago

Hi all, just a side note on the vocabulary here. We had previously the term "map preset" and now have "map theme". In fact, this is is somehow related to what the OGC defines as a "map Context", which even has its standard WMC. Web map context is a broader definition, more of the scop of a whole project file, but still I like the naming and we could maybe use it in tooltips to clarify what a theme is. "Themes" remind me of ArcView 3.2 and Mapinfo. Good old memories (or not) , but it reflects the fact that "theme" as no real semantic. Map Context is still a large concept, but a little bit more specific. Bye all Régis Le mer. 3 mars 2021 just a side note on the vocabulary here. We had previously the term "map preset" and now have "map theme".

@haubourg - I agree that "map context" may be a good term in this context - but I am unsure if we can rename things after they had been present in QGIS for many versions. In general, such discussions about "naming" need to be held early in the process. Once we accepted a term, we need to stick to it - think of all the poor users who have to cope with terms and would be really annoyed if we change the terms later on. And documentation, youtube videos, stack-exchange, mailing lists, etc. All of these refer to the original terms present for many years already. I would be reluctant to rename things later on ... even if "map context" might be a better term.

roya0045 commented 3 years ago

I think theme is a better term as it's more adapted to producing thematic maps. Maybe that's just me.

I'm slowly looking into building this, most element are straghtforward, the only thing I'm not too sure is the display. I've looked into the layout legend and the mask widget for inspiration to display layers and their symbology. I'm not too sure what is the best way to handle this. Suggestions on that aspect would be welcome.

haubourg commented 3 years ago

I agree that "map context" may be a good term in this context - but I am unsure if we can rename things after they had been present in QGIS for many versions. In general, such discussions about "naming" need to be held early in the process. Once we accepted a term, we need to stick to it - think of all the poor users who have to cope with terms and would be really annoyed if we change the terms later on. And documentation, youtube videos, stack-exchange, mailing lists, etc. All of these refer to the original terms present for many years already. I would be reluctant to rename things later on ... even if "map context" might be a better term.

@andreasneumann of course we can't change this now, I wasn't asking for. And sorry for not having seen this discussion when it occured. Following the flow is pretty hard.
My idea was more to add a tooltip on the "new theme" entry to make it more explicit.

roya0045 commented 3 years ago

I'm debating with myself to know if this would be better as a plugin or a core feature. I'm open to criticism as doing a plugin won't burden anyone to review my work and may get used sooner.

mach0 commented 3 years ago

You mean something like https://plugins.qgis.org/plugins/themeselector/ with added styling support?

roya0045 commented 3 years ago

@mach0 Not quite, what I envision is a view widget that displays only the layers of a given them with the ability to drap&drop layers from the layer widget to add layer or remove them from the theme this way. The only similarity is the combo-box with the names.

The goal is to easily see the layers associated with each themes and change them.

DelazJ commented 3 years ago

@roya0045 It could be nice to display next to the layers of a theme, the style being used. Sometimes you might wonder whether the style you are about to update is only used in the current map theme or not. That could help to answer. About whether plugin or not, sorry, no opinion. But I feel like being able to view what is inside a theme afterwards is a must have.

andreasneumann commented 3 years ago

@roya0045 - might be a good candidate for a QGIS grant 2021 project?

See https://blog.qgis.org/2021/02/21/qgis-grants-6-call-for-grant-proposals-2021/

roya0045 commented 3 years ago

@DelazJ That would become horrendous with multiple themes, I don't want to do it that way.

@andreasneumann No, I'm not doing this for funds, donation funds are better spent on better contributors. 😆

elpaso commented 3 years ago

@roya0045 - might be a good candidate for a QGIS grant 2021 project?

See https://blog.qgis.org/2021/02/21/qgis-grants-6-call-for-grant-proposals-2021/

Looks like a new feature to me unless it belongs to the "polishing" activities.

This year, we will not accept proposals for the development of new features. 
Therefore, proposals should focus on improving the QGIS project infrastructure and polishing existing features. 
The target version for all project work is QGIS 3.22.
andreasneumann commented 3 years ago

Looks like a new feature to me unless it belongs to the "polishing" activities.

Yes - depends on the definition/interpretation of "polishing". For me, it would be a polishing of the theme support, which I also think lacks polishing a bit.

elpaso commented 3 years ago

Looks like a new feature to me unless it belongs to the "polishing" activities.

Yes - depends on the definition/interpretation of "polishing". For me, it would be a polishing of the theme support, which I also think lacks polishing a bit.

Yeah, I think we need to be flexible. :+1:

roya0045 commented 3 years ago

Prototype image has been added. Browsing themes is fine, filtering is on a layer basis, so legend nodes are not filtered out.

Still need to figure out drag-import but the buttons to import selected layers from the view and the function to remove layers from the theme works fine.

I was thinking of adding buttons to add and remove themes.

roya0045 commented 3 years ago

PR is up, could not implement the drag & drop to safely remove layers at the moment, the remainder all seems ok.

roya0045 commented 3 years ago

If someone want to test the current widget a ming build should be available, I also have a build with all my pending work if this if of use to anyone else. Thanks!

roya0045 commented 3 years ago

Crashes fixed, others improvements made.

roya0045 commented 2 years ago

Working on another version, to have the support also be at the symbol/legend node lever and not just layer level. Also in the proposed branch the changes are in the layertree view & proxy, I migrated them in the ThemeViewer for the alternate approach to have a more 'isolated' PR.

Hannes-Ole commented 2 years ago

I am working with many themes as well and greatly endorse your venture to create something like a theme manager. What is the status on this? Is there a way to contribute (without much experience, but quite a bit of motivation)?

MicTric91 commented 2 years ago

I second this request since would be a major improvement in cartographic production

velle commented 2 years ago

If someone want to test the current widget a ming build should be available

I would certainly like to try it out. In fact your widget will make my current project a lot less frustrating, so thank you :) However, I don't understand what you mean by "ming build", and I am not sure what to do in order to try it out.

velle commented 2 years ago

I hope it is not wrong of me to post the following here. I experience many frustrations with the way the current QGIS lets me set up themes and styles for a report, so I appreciate this initiative. I want to share, that for my needs, a minimalistic text based input would be much simpler to handle than any GUI approach I can imagine. I have several sections in a report, and each section needs certain layers, with certain styles. Such a text based approach also makes it easier to experiment with different versions of theming of a project, and to copy and adapt themes from one project file to another.

Example of what such a format could look like in yaml.

- overview
  - {layer_name:'lamps', qml='lamps_overview.qml'}
  - {layer_name:'cables', qml='cables_overview.qml'}
  - {layer_name:'cables', qml='poles_overview.qml'}
  - {layer_name:'project_limits', qml='project_limits_overview.qml'}
  - {layer_name:'osm'}
- street_lamp_details
  - {layer_name:'lamps', qml='lamps_with_detail_labels.qml'}
  - {layer_name:'cables', qml='cables_quiet.qml'}
  - {layer_name:'cables', qml='poles_quiet.qml'}
  - {layer_name:'osm'}
- cable_details
  - {layer_name:'lamps', qml='lamps_quiet.qml'}
  - {layer_name:'cables', qml='cables_with_detail_labels.qml'}
  - {layer_name:'cables', qml='poles_quiet.qml'}
  - {layer_name:'osm'}
- post_details
  - {layer_name:'lamps', qml='lamps_quiet.qml'}
  - {layer_name:'cables', qml='cables_quiet.qml'}
  - {layer_name:'cables', qml='poles_with_detail_labels.qml'}
  - {layer_name:'osm'}

Sincerely.

Hannes-Ole commented 2 years ago

I looked for ways to privately message a github user, since roya0045 doesn't seem to read here anymore. Apparently there is no such feature, but a notification might work: @roya0045: Given that this request sees some traffic, it would be great if you could elaborate on progress you've made and how it could be built on.

roya0045 commented 2 years ago

I'm working on a new version when I can in my free time but I hit some hurdles to make things work properly in depth. I've already considered the feedback from a tester.

roya0045 commented 2 years ago

If someone want to test the current widget a ming build should be available

I would certainly like to try it out. In fact your widget will make my current project a lot less frustrating, so thank you :) However, I don't understand what you mean by "ming build", and I am not sure what to do in order to try it out.

Download the artefact at https://github.com/roya0045/QGIS_1/actions/runs/2435875135 It should be available for 5 days

harrodesu commented 3 months ago

How is it going? Is it still in development?