Skip to content
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

(capitalization?) error reading NHDPlus HR #177

Open
janetrbarclay opened this issue Jan 30, 2025 · 0 comments
Open

(capitalization?) error reading NHDPlus HR #177

janetrbarclay opened this issue Jan 30, 2025 · 0 comments

Comments

@janetrbarclay
Copy link

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 :

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:

Image

But when I open that layer in python (flvaa = gpd.read_file(NHDPlusHR_path, driver='OpenFileGDB', layer='NHDPlusFlowlineVAA')), the column names are all lowercase:

Image

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant