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
Error when creating BRAT table #109
Comments
I've looked at it, and from what I can tell, it looks like there's something going wrong with the following segment of code:
Specifically, something is causing |
The issue is that in the case of the Salmon there are only 2 'LUI_Class' categories: 'VeryLow' and 'High'. This is a case we haven't run into yet, which is totally fine, but it broke the code here. So we'll need to update the code. Braden, the attribute is from the 'LUI_Class'. The pivot table just transposes the table from a long format table to a wide format table. In this case that means turning the single column into 4 columns. But in this case not all 4 columns 'exist' once the table in transposed (only 2). Could you please edit the code so that if one of those 4 categories ('VeryLow', 'Low', 'Moderate', High') doesn't exist it assigns a value of '0' to the 'SUM_propArea' field? Once you've made the change please put up a new release and let Karen know so she can download it. Thanks! |
Just a clarification to make sure I'm understanding you right: After creating areaPivTbl, we want to check that the fields |
You're correct that the 'SUM_propArea' field doesn't exist in the pivot table. It's one of the fields that the pivot table is created from on this line:
The workflow that your suggesting should work. So, check that the fields |
@kbartelt the latest release should fix the problem. You can download it from the main page. |
There was a problem with the 3.0.14 release. I fixed it and created a new release. Sorry for the confusion, that was my bad. The tool downloaded from the main page now should be fine. |
@kbartelt, I'm sorry for versioning problems. 3.0.16 should solve this problem, without any of the code I was using to test it. Download the latest release, hopefully for the last time in a while. |
@banderson1618 that worked, thank you! |
I am coming across the following error when running BRAT Step 2 to create the BRAT Table for the Salmon watershed (18010210) for #97
I have tried restarting arcMap and my computer. Matt looked the files over for any obvious issues and tried running it on his computer which yielded the same error. @bangen @banderson1618 do you have any suggestions for how to resolve this? Thanks!
`Executing: BRAT_table_tool C:\Users\A02295870\Documents\FHC\Salmon_18010210\BRAT PrelimRun01 18010210 Salmon C:\Users\A02295870\Documents\FHC\Salmon_18010210\BRAT\Inputs\02_Network\Network_1\NHD_24k_300mReaches.shp C:\Users\A02295870\Documents\FHC\Salmon_18010210\BRAT\Inputs\03_Topography\DEM_1\NED_DEM_10m.tif # C:\Users\A02295870\Documents\FHC\Salmon_18010210\BRAT\Inputs\01_Vegetation\01_ExistingVegetation\Ex_Veg_1\LANDFIRE_140EVT.tif C:\Users\A02295870\Documents\FHC\Salmon_18010210\BRAT\Inputs\01_Vegetation\02_HistoricVegetation\Hist_Veg_1\LANDFIRE_140BPS.tif C:\Users\A02295870\Documents\FHC\Salmon_18010210\BRAT\Inputs\04_Conflict\01_ValleyBottom\Valley_1\ValleyBottom_Reaches_300m.shp C:\Users\A02295870\Documents\FHC\Salmon_18010210\BRAT\Inputs\04_Conflict\02_Roads\Roads_1\tl_2017_county_roads.shp C:\Users\A02295870\Documents\FHC\Salmon_18010210\BRAT\Inputs\04_Conflict\03_Railroads\Railroads_1\tl_2017_rails.shp C:\Users\A02295870\Documents\FHC\Salmon_18010210\BRAT\Inputs\04_Conflict\04_Canals\Canals_1\NHDCanals.shp C:\Users\A02295870\Documents\FHC\Salmon_18010210\BRAT\Inputs\04_Conflict\05_LandUse\Land_Use_1\LANDFIRE_140EVT.tif BRAT_Table true #
Start Time: Thu Jul 05 15:31:20 2018
Running script BRAT_table_tool...
Adding "iGeo" attributes to network
calculating drainage area
Adding "iVeg" attributes to network
Adding "iPC" attributes to network
Traceback (most recent call last):
File "", line 321, in execute
File "C:\Users\A02295870\Documents\FHC\pyBRAT\BRAT_table.py", line 120, in main
ipc_attributes(seg_network_copy, road, railroad, canal, valley_bottom, buf_30m, buf_100m, landuse, scratch, projPath)
File "C:\Users\A02295870\Documents\FHC\pyBRAT\BRAT_table.py", line 605, in ipc_attributes
for row in cursor:
RuntimeError: A column was specified that does not exist.
Failed to execute (BRAT_table_tool).
Failed at Thu Jul 05 15:39:57 2018 (Elapsed Time: 8 minutes 36 seconds)`
The text was updated successfully, but these errors were encountered: