pygeohydro.helpers#

Some helper function for PyGeoHydro.

Module Contents#

pygeohydro.helpers.get_us_states(subset_key=None)#

Get US states as a GeoDataFrame from Census’ TIGERLine 2023 database.

Parameters:

subset_key (str or list of str, optional) – Key to subset the geometries instead of returning all states, by default all states are returned. Valid keys are:

  • contiguous or conus

  • continental

  • commonwealths

  • territories

  • Two letter state codes, e.g., ["TX", "CA", "FL", ...]

Returns:

geopandas.GeoDataFrame – GeoDataFrame of requested US states.

Return type:

geopandas.GeoDataFrame

pygeohydro.helpers.nlcd_helper()#

Get legends and properties of the NLCD cover dataset.

Notes

The following references have been used:
Returns:

dict – Years when data is available and cover classes and categories, and roughness estimations.

Return type:

dict[str, Any]

pygeohydro.helpers.nwis_errors()#

Get error code lookup table for USGS sites that have daily values.

pygeohydro.helpers.states_lookup_table()#

Get codes and names of US states and their counties.

Notes

This function is based on a file prepared by developers of an R package called dataRetrieval.

Returns:

pandas.DataFrame – State codes and name as a dataframe.

Return type:

dict[str, StateCounties]