InVEST documentation





The freshwater models in InVEST are routed across a digital elevation model (DEM). In the course of developing InVEST we’ve found existing implementations of flow direction and flow accumulation algorithms to be lacking. To address this need, we have developed our own high performance implementations of the D8 flow direction algorithm and fractional flow (“Multiple Flow Direction” - MFD), combined with a plateau resolution algorithm to route across flat areas (Garbrecht and Martz) that outperforms TauDEM and GRASS implementations. We feel these implementations are useful enough that we offer them as a standalone tool that can:

  • Fill hydrological sinks.

  • Resolve flat areas in a DEM so that all regions drain to some point.

  • Compute flow direction across a DEM.

  • Compute flow accumulation across a DEM.

  • Create streams based on flow accumulation.

This tool may be useful when you are preparing your DEM for use in the freshwater models. For these models, you will want to create streams that are continuous (not all chopped up), and you will need to choose a Threshold Flow Accumulation value that creates a modeled stream network that is as close as possible to the real-world stream network. Using RouteDEM you can test your DEM, see how InVEST handles it, and create stream rasters to help you choose an appropriate Threshold value, without needing to run the whole freshwater model.

After installing InVEST, this tool can be found in the start menu under the InVEST folder as a utility called RouteDEM.

RouteDEM will always resolve sinks and plateaus before routing flow.

Tool Inputs

  • Workspace (directory, required): The folder where all the model’s output files will be written. If this folder does not exist, it will be created. If data already exists in the folder, it will be overwritten.

  • File Suffix (text, optional): Suffix that will be appended to all output file names. Useful to differentiate between model runs.

  • Digital Elevation Model (raster, units: m, required): Map of elevation above sea level. Hydrological sinks and flat plateau regions will be automatically resolved by the model.

  • Band Index (number, optional): Index of the raster band to use, for multi-band rasters. If not provided, band index 1 will be used.

  • Routing Algorithm (option, required): The routing algorithm to use.


    • D8: {‘display_name’: ‘D8’, ‘description’: ‘All water on a pixel flows into the most downhill of its 8 surrounding pixels’}

    • MFD: {‘display_name’: ‘MFD’, ‘description’: ‘Flow off a pixel is modeled fractionally so that water is split among multiple downstream pixels’}

  • Calculate Slope (true/false): Calculate percent slope from the provided DEM.

  • Calculate Flow Direction (true/false): Calculate flow direction from the provided DEM. This will be written to the output file flow_direction.tif.

  • Calculate Flow Accumulation (true/false): Calculate flow accumulation from the flow direction output. This will be written to the output file flow_accumulation.tif.

  • Calculate Streams (true/false): Calculate streams from the flow accumulation output. This will be written to the output file stream_mask.tif. All pixels in the flow accumulation raster that have a value greater than or equal to the Threshold Flow Accumulation Limit will be considered a stream.

  • Threshold Flow Accumulation (number, units: pixel, conditionally required): The number of upstream pixels that must flow into a pixel before it is classified as a stream. Required if Calculate Streams is selected.

  • Calculate Distance To Stream (true/false): Calculate flow distance from each pixel to a stream as defined in the Calculate Streams output. This will be written to the output file downstream_distance.tif in the workspace. Distance is given in number of pixels. To translate this pixel distance to linear units, multiply the downstream_distance.tif raster by the pixel size.


Garbrecht, J., Martz, L. W.,The assignment of drainage direction over flat surfaces in raster digital elevation models, Journal of Hydrology, Volume 193, Issues 1–4, 1 June 1997, Pages 204-213, ISSN 0022-1694, (