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

Can add a layer twice to the QGIS model #1683

Open
deltamarnix opened this issue Aug 2, 2024 · 2 comments
Open

Can add a layer twice to the QGIS model #1683

deltamarnix opened this issue Aug 2, 2024 · 2 comments
Labels
bug Indicates an unexpected problem or unintended behavior QGIS Ribasim QGIS plugin

Comments

@deltamarnix
Copy link
Contributor

  • Open QGIS and ensure that the Ribasim plugin is installed and enabled.
  • Open the application via the Ribasim button on the QGIS toolbar: Ribasim panel opens.
  • Press the "New" button in the Model tab: file navigation window pops up.
  • Fill in a name ("test1").
  • Press OK: A toml and database file are created on the given location.
  • Press the "Edge" layer in the Model tab
  • Press "Add to QGIS": A second Edge layer is added to the model.

Expected: the "Add to QGIS" button is disabled, because Edge is already in the model.

@deltamarnix deltamarnix added QGIS Ribasim QGIS plugin bug Indicates an unexpected problem or unintended behavior labels Aug 2, 2024
@deltamarnix
Copy link
Contributor Author

It would perhaps be easier if we don't have this whole synchronization panel in the Model tab. The Layers panel should already tell enough should be the ultimate truth. "Add to QGIS" and "Remove from Dataset" should be removed and the Layers panel should be the geo package itself, no clone.

@Huite
Copy link
Contributor

Huite commented Aug 2, 2024

It would perhaps be easier if we don't have this whole synchronization panel in the Model tab.

I agree it would be easier, and the synchronization has caused me a fair bit of pain in the past. But:

The Layers panel should already tell enough should be the ultimate truth.

This is not the case, and it can't be; the layers panel is not a clone. The Model tab is more like a clone of the Browser Panel:

image

Presence in the layers panel makes QGIS aware of the layer. You can add or remove features, change the styling, etc., but you cannot delete for example. Deleting Layers requires access through the browser panel. The Layers panel is largely cosmetic: note that you can change the name of a Layers panel, but this does not update the name in the geopackage! It just gives you the freedom to display layers with a different name in your legend e.g. if you're making maps.
Likewise, deleting a layer in the Layers panel simply makes QGIS unaware of the layer's existence.

Then, if you accidentally remove a layer from the Layers panel, it's still in the geopackage and it's still in the model; the data is not deleted. You can only get the layer back by going through the Browser panel and re-adding it to the Layers panel. Alternatively, you just re-open the TOML file and let the plugin do the work.

I think it's worth considering to get rid of the "Add to QGIS" button, and introduce a different button called "Restore (from project)" -- see: #1687. That way, whenever you screw up your Layers panel, you can just reinstantiate it. Still, I think, you might as well keep "Add to QGIS" because the add_selection_to_qgis allows a user to precisely add back one layer after accidentally deleting it.
But the "Remove from Dataset" button should not be removed, because it's very tedious to delete geopackage layers using the Browser panel.

evetion pushed a commit that referenced this issue Aug 27, 2024
An initial QGIS test plan for the plugin. There are still some tests to
be written.
I have also performed all these tests and created quite some new
reports.
There is also a known issues page for all of Ribasim, as we have some
things that simply don't work as expected.

New issues:

* #1678 
* #1679 
* #1681 
* #1682 
* #1683 
* #1684 
* #1685 
* #1688 
* #1689 
* #1690 

Fixes #320

---------

Co-authored-by: Martijn Visser <mgvisser@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior QGIS Ribasim QGIS plugin
Projects
Status: To do
Development

No branches or pull requests

2 participants