Riverscapes / QRAVEPlugin

QGIS Plugin for viewing Riverscapes projects
GNU General Public License v3.0
0 stars 0 forks source link

Missing XPath Crashes Project Load #41

Closed philipbaileynar closed 3 years ago

philipbaileynar commented 3 years ago

The following VBET business logic error was causing the entire project to not load at all. Notice the empty xpath attribute:

 <Children>
    <Node label="Normalized Slope Evidence" xpath="Raster[@id='NORMALIZED_SLOPE']" type="raster" symbology="norm_slope" transparency="40" />
    <Node label="Normalized HAND Evidence" xpath="Raster[@id='NORMALIZED_HAND']" type="raster" symbology="norm_hand" transparency="40" />
    <Node label="Normalized TWI Evidence" xpath="Raster[@id='NORMALIZED_TWI']" type="raster" symbology="norm_twi" transparency="40" />
    <Node label="Normalized Channel Evidence" xpath="" type="raster" symbology="norm_channel" transparency="40" />
    <Node label="Combined Topographic Evidence" xpath="Raster[@id='EVIDENCE_TOPO']" type="raster" symbology="norm_topo" transparency="40" />
</Children>

QRAVE needs to be able to handle this more elegantly. Correct behaviour should be to raise a warning and continue loading, skipping the offending layer in question.

The error I was getting mentioned default_view, a complete red herring. Took me an hour to tediously comment out lines in the business logic until I found the problem!

MattReimer commented 3 years ago

Agreed that we should have an error for this. If the layer being referenced was part of a view (or worse a default view) that's probably why we were having the mislead and subsequent 🦆 chase.

@philipbaileynar if you still have it can you attach the entire project xml to this ticket or provide a link to the RS warehouse project? We want to make sure we can repro fully

philipbaileynar commented 3 years ago

I don't think you need the project. It was a BL problem. But it is attached anyway.

MattReimer commented 3 years ago

Thanks. We can also build checks for empty xpaths into the python validator. Might save us even having this problem again