pynhd.nhdplus_derived

Access NLDI and WaterData databases.

Module Contents

pynhd.nhdplus_derived.enhd_attrs(parquet_path=None, expire_after=EXPIRE, disable_caching=False)

Get updated NHDPlus attributes from ENHD.

Notes

This downloads a 140 MB parquet file from here . Although this dataframe does not include geometry, it can be linked to other geospatial NHDPlus dataframes through ComIDs.

Parameters
  • parquet_path (str or Path, optional) – Path to a file with .parquet extension for storing the file, defaults to ./cache/enhd_attrs.parquet.

  • expire_after (int, optional) – Expiration time for response caching in seconds, defaults to -1 (never expire).

  • disable_caching (bool, optional) – If True, disable caching requests, defaults to False.

Returns

pandas.DataFrame – A dataframe that includes ComID-level attributes for 2.7 million NHDPlus flowlines.

pynhd.nhdplus_derived.nhd_fcode()

Get all the NHDPlus FCodes.

pynhd.nhdplus_derived.nhdplus_attrs(name=None, parquet_path=None, expire_after=EXPIRE, disable_caching=False)

Access NHDPlus V2.1 Attributes from ScienceBase over CONUS.

More info can be found here.

Parameters
  • name (str, optional) – Name of the NHDPlus attribute, defaults to None which returns a dataframe containing metadata of all the available attributes in the database.

  • parquet_path (str or Path, optional) – Path to a file with .parquet extension for saving the processed to disk for later use. Defaults to ./cache/nhdplus_attrs.parquet.

  • expire_after (int, optional) – Expiration time for response caching in seconds, defaults to -1 (never expire).

  • disable_caching (bool, optional) – If True, disable caching requests, defaults to False.

Returns

pandas.DataFrame – Either a dataframe containing the database metadata or the requested attribute over CONUS.

pynhd.nhdplus_derived.nhdplus_vaa(parquet_path=None, expire_after=EXPIRE, disable_caching=False)

Get NHDPlus Value Added Attributes with ComID-level roughness and slope values.

Notes

This downloads a 200 MB parquet file from here . Although this dataframe does not include geometry, it can be linked to other geospatial NHDPlus dataframes through ComIDs.

Parameters
  • parquet_path (str or Path, optional) – Path to a file with .parquet extension for storing the file, defaults to ./cache/nldplus_vaa.parquet.

  • expire_after (int, optional) – Expiration time for response caching in seconds, defaults to -1 (never expire).

  • disable_caching (bool, optional) – If True, disable caching requests, defaults to False.

Returns

pandas.DataFrame – A dataframe that includes ComID-level attributes for 2.7 million NHDPlus flowlines.

Examples

>>> vaa = nhdplus_vaa() 
>>> print(vaa.slope.max()) 
4.6