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

Layers cannot have the same name #66

Open
MattReimer opened this issue Nov 9, 2021 · 4 comments
Open

Layers cannot have the same name #66

MattReimer opened this issue Nov 9, 2021 · 4 comments
Labels
🐛 bug Something isn't working 🌐 Viewer QGIS
Milestone

Comments

@MattReimer
Copy link
Member

MattReimer commented Nov 9, 2021

Sometimes we have a case like this in the business logic:

<Children>
  <Node label="Existing Dam Capacity" xpath="Geopackage/Layers/Vector[@id='BRAT_RESULTS']" type="line" symbology="oCC_EX_filtered" id="ex_capacity" filter="&quot;ReachCode&quot;=46006 OR &quot;ReachCode&quot; = 33600 OR &quot;ReachCode&quot; = 55800 " />  
  <Node label="Existing Dam Size" xpath="Geopackage/Layers/Vector[@id='BRAT_RESULTS']" type="line" symbology="mCC_EX_CT_filtered" filter="&quot;ReachCode&quot;=46006 OR &quot;ReachCode&quot; = 33600 OR &quot;ReachCode&quot; = 55800 " />
  <Node label="Historic Dam Capacity" xpath="Geopackage/Layers/Vector[@id='BRAT_RESULTS']" type="line" symbology="oCC_HPE_filtered" id ="his_capacity" filter="&quot;ReachCode&quot;=46006 OR &quot;ReachCode&quot; = 55800 " />
  <Node label="Historic Dam Size" xpath="Geopackage/Layers/Vector[@id='BRAT_RESULTS']" type="line" symbology="mCC_HPE_CT_filtered" filter="&quot;ReachCode&quot;=46006 OR &quot;ReachCode&quot; = 55800 " />
  <Node label="Capacity for Entire Network (overestimate including non-perennial) ">
    <Children>
      <Node label="Existing Dam Capacity" xpath="Geopackage/Layers/Vector[@id='BRAT_RESULTS']" type="line" symbology="oCC_EX"  />
      <Node label="Existing Dam Size" xpath="Geopackage/Layers/Vector[@id='BRAT_RESULTS']" type="line" symbology="mCC_EX_CT"  />
      <Node label="Historic Dam Capacity" xpath="Geopackage/Layers/Vector[@id='BRAT_RESULTS']" type="line" symbology="oCC_HPE" />
      <Node label="Historic Dam Size" xpath="Geopackage/Layers/Vector[@id='BRAT_RESULTS']" type="line" symbology="mCC_HPE_CT"  />
    </Children>
  </Node>
</Children>

In such cases QRave will simply refuse to load the second layer.

It seems like we're name matching the layers when we add them to the map so we should really do something more to make sure we have uniqueness.

For now we'll just tell people not to do this (looking at you @joewheaton)

For the BRAT case I've added " (All)" to the end of each layer name. It's an imperfect fix but it buys us time to solve this on our own schedule for the next version.

@MattReimer MattReimer added the 🐛 bug Something isn't working label Nov 9, 2021
@MattReimer MattReimer added this to the QRAVE 0.7.1 Bug fixes milestone Nov 9, 2021
@joewheaton
Copy link

@MattReimer I just checked some projects in WebRAVE and QRAVE and these "temporary" fixes are forcing the desired behavior for the end-user. I like what you're saying here about this not being the ideal final solution, but for our short term problems, this is great.

Thanks!

@joewheaton
Copy link

joewheaton commented Nov 9, 2021

I thought I posted this, but apparently I did not:
Riverscapes/RiverscapesXML#375 (comment)

@MattReimer
Copy link
Member Author

This may have a similar solution to ArcRave projects with the same name.
Riverscapes/RaveAddIn#175

@philipbaileynar
Copy link
Contributor

FWIW QRiS will never experience this problem because it tags each map layer with the in-memory QRiS object with which it is associated. This allows recursion to then find the map layer by comparing each layer's tag with the same in-memory object. Names are never checked.

The downside of this memory-based matching is that I don't think that we can use QGZ files with QRiS because the QRiS memory addresses will not only change between sessions, but I'm not even sure if QGIS will repopulate these in-memory objects on reload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🌐 Viewer QGIS
Projects
None yet
Development

No branches or pull requests

3 participants