DWCON

Drainage watershed conditioning


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Examples :: References :: Related

Back to top

Description


Performs four conditioning procedures for drainage and watershed programs. This program must be executed before any drainage and watershed programs.
Back to top

Parameters


dwcon(file, dbec, fdep, fdirect, faccum, fdelta, dbiw)

Name Type Caption Length Value range
FILE* str Input file name 1 -    
DBEC* List[int] Input elevation channel 1 - 1 1 - 1024
FDEP* List[int] Output fill depression channel 1 - 1 1 - 1024
FDIRECT* List[int] Output flow direction channel 1 - 1 1 - 1024
FACCUM* List[int] Output flow accumulation channel 1 - 1 1 - 1024
FDELTA* List[int] Output flow delta value channel 1 - 1 1 - 1024
DBIW List[int] Raster input window 0 - 4 Xoffset, Yoffset, Xsize, Ysize

* Required parameter
Back to top

Parameter descriptions

FILE

Specifies the name of the PCIDSK image file to process.

DBEC

Specifies the input channel that contains the elevation data. The input channel can be 8-bit, 16-bit or 32-bit.

FDEP

Specifies the output channel to receive the filled depression result. The output channel must be either 16-bit signed integer or 32-bit real.

FDIRECT

Specifies the output channel to receive the flow direction result. The output channel must be either 16-bit signed integer or 32-bit real.

FACCUM

Specifies the output channel to receive the flow accumulation result. The output channel must be either 16-bit signed integer or 32-bit real.

FDELTA

Specifies the output channel to receive the flow delta value result. The output channel must be either 16-bit signed integer or 32-bit real.

DBIW

Specifies the raster window (Xoffset, Yoffset, Xsize, Ysize) that is read from the input image. If this parameter is not specified, the entire image is processed by default.

Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.

Back to top

Details

DWCON performs four conditioning procedures for drainage and watershed functions. DWCON must be executed before any drainage and watershed functions.

All functions are based on the article cited in References.

Six functions make up the drainage network component:

To use the drainage analysis functions, you must first run DWCON.

DWCON produces the following four data sets required for all subsequent drainage analysis functions:

DWCON can handle up to 20K x 20K images on the workstation. If the limit is exceeded, you can execute the function repeatedly using different image window sizes.

Four output channels are required to store the four data set results. Due to the use of negative values in the results, the four output channels MUST be either 16-bit signed integer or 32-bit real channels. Because the maximum allowable value for a 16-bit signed channel is 32768, for a large DEM it is recommended that you use a 32-bit real channel for the flow accumulation output channel to avoid computer integer overflow problems. You can add channels to the PCIDSK file using the PCIMOD function.

Because all the calculations are in integers, to use real numbers with decimal places, you must multiply all values inside a DEM by a factor of 10. This can be done by using the ARI or MODEL functions.

The four output channels are:
Note: This function requires a significant amount of computation time.

Filling depressions

Digital elevation data always contains depressions that hinder flow routing. The objective of the first step in the conditioning phase is to create an adjusted 'depressionless' digital elevation image in which the cells contained in depressions are raised to the lowest elevation value on the rim of the depression. Each cell in the depressionless digital elevation data set will then be part of at least one monotonically decreasing path of cells leading to an edge of the data set. A path is composed of cells adjacent horizontally, vertically, or diagonally in the raster (eight-way connectedness) and that steadily decrease in value. If there are negative values in the elevation data, DWCON will look for the minimum negative value in the channel and add the absolute of the value to the entire channel so that all elevation data is positive.

Flow direction

This procedure builds the flow direction data set. The flow direction for a cell is the direction in which water will flow out of the cell. It is encoded to correspond to the orientation of one of the eight cells that surround the cell (x) as follows:

                64     128      1
                32       x      2
                16       8      4

For example, if cell x flows to the left in the matrix, its flow direction will be encoded as a 32. Flow direction encoding is done in powers of two so that surrounding conditions correspond to unique values when the powers of two are summed.

Flow accumulation

This procedure makes use of the flow direction data set to create the flow accumulation data set, where each cell is assigned a value equal to the number of cells that flow to it. Cells having a flow accumulation value of zero (to which no other cells flow) generally correspond to the pattern of ridges. Because all cells in a depressionless digital elevation data set have a path to the data set edge, the pattern formed by highlighting cells with values higher than some threshold value delineates a fully connected drainage network. As the threshold value is increased, the density of the drainage network decreases. To avoid computer integer overflow, it is recommended that you use 32-bit real channels for large database DEMs.

Flow delta value

This procedure produces a delta value data set. Delta value is the amount of increase in flow accumulation value in the flow direction. This data set is useful for automatic seed generation and pour point table calculations.

After DWCON

After running DWCON, you can run the following series of functions for various applications:
  1. To delineate all watersheds automatically:
    • Run the SEED function to generate seed points automatically.
    • Run the WTRSHED function to find the watersheds.
  2. To delineate specific watersheds of known coordinates:
    • Run the SEED function to generate seed points based on an input file which contains the watershed coordinates.
    • Run the WTRSHED function to find the watersheds.
  3. To find the overland path (flow path) of the drainage network:
    • Run the SEED function to generate the point sources.
    • Run the OVERLND function to track the overland path of the point sources.
    Note: One practical application of this process is to track the overland path of pollution from a point source into the drainage network.
  4. To show the drainage network:
    • Run the DRAIN function to show the drainage network.
  5. To find out the pour points between all watersheds, the point of lowest elevation on the common boundary between the two watersheds:
    • Use one of the methods mentioned above for generating the watersheds (1 or 2).
    • Run the PPTABLE function to find all the pour points between watersheds.
Back to top

Examples

The following is an example of calculating four conditioning data sets for the demo file irvine.pix. First, copy the irvine.pix to your own account.

Use PCIMOD to add six 16-bit signed integer channels to the file.

from pci.pcimod import *

file	=	'irvine.pix'
pciop	=	'ADD'
pcival	=	[0,6,0,0]	# add three 16-bit signed channels

pcimod( file, pciop, pcival )

Calculate the four conditioning data sets using DWCON.

from pci.dwcon import *

file	=	'irvine.pix'
dbec	=	[10]	# input elevation channel
fdep	=	[11]	# output filled depression channel
fdirect	=	[12]	# output flow direction channel
faccum	=	[13]	# output flow accumulation channel
fdelta	=	[14]	# output flow delta value channel
dbiw	=	[]	# process entire image

dwcon( file, dbec, fdep, fdirect, faccum, fdelta, dbiw )
Back to top

References

Jenson, S.K. and Domingue, J.O. "Extracting Topographic Structure from Digital Elevation Data for Geographic Information System Analysis". Photogrammetric Engineering and Remote Sensing, Vol. 54, No. 11, November 1988, pp. 1593-1600.

© PCI Geomatics Enterprises, Inc.®, 2024. All rights reserved.