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

Button for adding all layers of a Theme #89

Open
effjot opened this issue Oct 4, 2021 · 7 comments
Open

Button for adding all layers of a Theme #89

effjot opened this issue Oct 4, 2021 · 7 comments

Comments

@effjot
Copy link
Contributor

effjot commented Oct 4, 2021

I’m not sure if I understood the goal of the Themes field correctly, but during my evaluation of the plugin, this use case came up:

I have created themes for topics and spatial divisions like

  • base information for Germany
  • base information for the State of Brandenburg
  • hydrogeology for the State of Brandenburg
  • water management for the State of Brandenburg
  • protection zones for the State of Brandenburg
  • base information for the State of Saxony-Anhalt
  • hydrogeology for the State of Saxony-Anhalt

  • and assigned layers to them.

So when I need to get started with a map e.g. for the State of Brandenburg, I would like to add the themes “base information for Brandenburg“ and „hydrogeology Brandenburg“ to have the layers I usually need conventiently loaded all at once.

I have added a button to the dock, which offers me a list selection of database (if more than one DB is connected) and of the available themes. When I select a theme, all the layers in that theme get added as a layer group.

grafik

Is this a use case of general interest? If so, I can prepare a PR.

@Gustry
Copy link
Member

Gustry commented Oct 8, 2021

Hi,

I think it's a good idea to have this kind of feature.

We were thinking what would the best option to provide this feature :

  • 1 : add it in the locator bar ? We can add support of theme in the locator bar and it will load all layers.
  • 2 : add it in the "Layer" -> "Add layers" menu. Plugin can hook their own action their.
  • 3 : from the dock like your screenshot, but instead of creating a new dialog and then having a combobox, why not having the dropdown menu straight in the dock ? Exactly like the export menu, with all options in the dropdown.

Option 3 needs to have to dock opened before.

@Gustry
Copy link
Member

Gustry commented Oct 11, 2021

Side note, but I'm very used to open the "Browser" panel in QGIS to open new files, browser my postgis etc.

I was wondering to have a "PgMetadata" item in this tree, with maybe a tree showing all theme ? and then all layers (with the name formatted nicely from the pgmetadata table).

I know it's redundant with the "Postgis" item, but it's one is ordered by schemas and then by table name. The PgMetadata one would be more "organized" according to pgmetadata table.

@image80
Copy link

image80 commented Oct 11, 2021

A / EXPLORER
I think it could have been very interesting to be able to add this scenario:
Display of the dock contents as soon as the user selects a table in the explorer. The explorer is for me
the most ergonomic access (we see in particular the tree structure of the schemas, of the geometry type). Currently, When we select the table there is the tooltip that shows the abstract pgmetadata. When we right click, the properties of the abstract are also displayed.
However, As far as i know, there is currently no search tool in the explorer (unlike the locator or the Data source manager).
I don't know if it would be possible to add it?

B / DATA SOURCE MANAGER
In my opinion, the search for data in the catalog via the Data source manager is interesting. But currently we can
Only search the "comment" field (which is called abstract in pgmetadata). Not possible for example on fields
"Key words". Personally, I find the interface of the data source manager not very ergonomic.

C / LOCATOR
Searching via the Locator is interesting. But in my opinion it would be necessary to add the possibility of displaying the contents of the dock only by a selection. Without having to load the data into the layer panel. The user should not have to load the layers to be able to select the one that interests him.Especially since some data is voluminous.

D / OTHER IDEA ? TOOL VIA PROCESSING ? OTHER ?

@effjot
Copy link
Contributor Author

effjot commented Oct 11, 2021

Explorer sounds like a good idea, as this is my first place I turn to for finding and adding stuff. There is a filter tool, though it doesn’t expand the sections it finds results in.

I use the locator mostly for search+add or seach+pan/highlight operations. Putting the „add theme“ there, too, feels a bit overloaded to me.

I added only a button to the dock (with subsequent dialogs) because it was less work. I was too lazy to build a new UI component in the designer for the proof of concept. ;-)

@image80 I originally tried to add the functionality to the processing toolbox, as I had a bit more experience in that area. But I realised that adding layers from there didn’t work as easily as from the dock code.

@effjot
Copy link
Contributor Author

effjot commented Mar 6, 2022

I’ve tried adding the functionality to the Add Layers menu. This was very straightforward.

However, I have no clue about how to add a new item to the browser panel. The functions seem to be there, but I can’t figure it out, and I haven’t found any plugins I could use as an example.

@Gustry
Copy link
Member

Gustry commented Mar 7, 2022

I haven’t found any plugins I could use as an example.

Mergin, Geonode are plugins adding custom item in the browser.

QgsBrowserModel from QgisInterface seems the way to go ?

@effjot
Copy link
Contributor Author

effjot commented Mar 7, 2022

Thank you for the pointers to the plugins! I hope I can have a detailed look in the next few days. I had already found QgsBrowserModel, but couldn’t quite understand how it works. I managed to quickly crash Qgis, though. :-D I just need some time to grok the browser model. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants