-
Notifications
You must be signed in to change notification settings - Fork 23
Description
We are trying to generate lines from NHDPlus HR and are getting this error:
"None of [Index(['NHDPlusID', 'ArbolateSu', 'StreamOrde', 'MaxElevSmo', 'MinElevSmo',\n 'Divergence'],\n dtype='object')] are in the [columns]"
This error appears to originate from these lines and to be related to capitalization of column names in flvaa :
sfrmaker/sfrmaker/nhdplus_utils.py
Lines 359 to 363 in 036ea3e
| flvaa = gpd.read_file(f, driver='OpenFileGDB', layer='NHDPlusFlowlineVAA') | |
| flvaa['NHDPlusID'] = flvaa['NHDPlusID'].astype(int).astype(str) | |
| fl = fl.merge(flvaa[['NHDPlusID', 'ArbolateSu','StreamOrde', 'MaxElevSmo', 'MinElevSmo', 'Divergence']], | |
| on='NHDPlusID', how='left' | |
| ) |
When I open the NHDPlusFlowlineVAA layer in ArcPro, the column headings are capitalized as in the sfrmaker code:
But when I open that layer in python (flvaa = gpd.read_file(NHDPlusHR_path, driver='OpenFileGDB', layer='NHDPlusFlowlineVAA')), the column names are all lowercase:
I'm using sfrmaker = 0.11.3 ; pandas = 2.2.3; geopandas =1.0.1; shapely 2.0.6 and am trying to read NHDPLUS_H_0109_HU4_20230713_GDB.gdb

