Skip to content

(capitalization?) error reading NHDPlus HR #177

@janetrbarclay

Description

@janetrbarclay

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions