Riverscapes / pyBRAT

pyBRAT - Beaver Restoration Assessment Tool (Python)
http://brat.riverscapes.xyz
GNU General Public License v3.0
10 stars 10 forks source link

Failed to find Existing Veg Suitability Layer #239

Closed philipbaileynar closed 5 years ago

philipbaileynar commented 6 years ago
  1. Note that I'm using ArcGIS 10.4 with all the extensions.
  2. Clicked on the Step 1. BRAT Project Builder tool.
  3. I supplied all the inputs (all layers except ownership)
  4. Click OK and got the following error.

2018-11-29_155331

Note that I do appear to have the specified layer file. Could it be an ArcGIS version issue?

2018-11-29_155630

banderson1618 commented 6 years ago

This very well could be a problem with versioning, but it might also be a problem with applying symbology to vegetation rasters, which we've had problems with before.

In "BRATProject.py", from line 74 to line 86, the program calls the function makeInputLayers() a bunch of times. I'd recommend commenting out those calls, and seeing if that helps.

banderson1618 commented 6 years ago

This issue may rear its head later on in the Layer Package Generator, since there is a similar function called there, but we can deal with that when we get there.

philipbaileynar commented 6 years ago

Perhaps the code is trying to apply a classification from a layer file that is either expecting a certain attribute/field that doesn't exist or the number of bins in the dataset that was used to generate the layer file is different from the target dataset to which it is being applied. Similar problems arrive when applying stretch renderers to datasets that possess a different range.

I commented out the lines you referred to and it broken further on regarding DEM symbolization.

Then I skipped ahead to step 2 and the BRAT table and got overwhelmed at the prospect of having to browse to 20 inputs!

banderson1618 commented 6 years ago

Hm... That's odd, we've never had a problem with applying symbology to DEMs. That does seem to imply a problem with your installation of ArcGIS, rather than a problem with the data. Unfortunately, since I can't replicate the bug on my computer, my ability to troubleshoot is limited.

A short term solution would be the following: in the makeLayer() function in "BRATProject.py", you can replace the line

    if symbology_layer:
        arcpy.ApplySymbologyFromLayer_management(new_layer, symbology_layer)

with

    if symbology_layer and isRaster:
        arcpy.ApplySymbologyFromLayer_management(new_layer, symbology_layer)

That should be on line 217-218. Unfortunately, this was before we consolidated the makeLayer() into a single function, so if you run into this problem again later on, you'll need to make that same change in that tool's copy of the makeLayer() function.