pygeoc.hydro module

Hydrology relation functions, e.g. FlowDirectionCode

@author: Liangjun Zhu

@changlog: - 17-06-25 lj - check by pylint and reformat by Google style. - 18-02-05 lj - compatible with Python3

class pygeoc.hydro.D8Util

Bases: object

Utility functions based on D8 flow direction Currently, D8 flow direction code of TauDEM, ArcGIS, Whitebox GAT are supported.

static convert_code(in_file, out_file, in_alg='taudem', out_alg='arcgis', datatype=None)

convert D8 flow direction code from one algorithm to another. :param in_file: input raster file path :param out_file: output raster file path :param in_alg: available algorithms are in FlowModelConst.d8_dirs. “taudem” is the default :param out_alg: same as in_alg. “arcgis” is the default :param datatype: default is None and use the datatype of the in_file

static downstream_index(dir_value, i, j, alg='taudem')

find downslope coordinate for D8 direction.

class pygeoc.hydro.FlowModelConst

Bases: object

flow direction constants according to different flow model

static get_cell_length(flow_model)

Get flow direction induced cell length dict. :param flow_model: Currently, “TauDEM”, “ArcGIS”, and “Whitebox” are supported.

static get_cell_shift(flow_model)

Get flow direction induced cell shift dict. :param flow_model: Currently, “TauDEM”, “ArcGIS”, and “Whitebox” are supported.