Closed philipbaileynar closed 3 months ago
The huc 10 does not seem to exist for this huc (1204020205). Might be an edge case where the NHD is missing along texas (this huc is listed as East Galveston Bay). The thing to do here is probably provide a useful message and exit gracefully...
PR #936 introduced a minor bug when cleaning NHD data. It seems related to whether the NHD data include the HUC2 feature class or not. @KellyMWhitehead wrote some code to handle missing HUC2 feature class and this pathway works. However, when the HUC2 feature class DOES exist the code throws an indexing error.
Working Code
When running RSContext for HUC 1601010101 the code passes and works. Note that the
layer
variable isNone
and so the code proceeds down the new code that @KellyMWhitehead wrote within theelse
pathway.Failing Code
When running RSContext for HUC 1204020205 the code fails.
layer
is valid and line 43 is run. The code then errors on line 73 because layer is a pointer to an individual layer and not a list of layers.https://github.com/Riverscapes/riverscapes-tools/blob/5050aa025497c2add0f01b8803f40ac8b3ceeccf/lib/commons/rscommons/clean_nhd_data.py#L41-L74
Error Information
From @r-k-g run: