Skip to content

v.stream.inbasin

Subset a stream network into just one of its basins

v.stream.inbasin [-s] input_streams=name [input_basins=name] [draindir=name] [cat=string] [coordinates=east,north] [output_basin=name] [output_streams=name] [output_pour_point=name] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

v.stream.inbasin input_streams=name coordinates=east,north

grass.script.run_command("v.stream.inbasin", input_streams, input_basins=None, draindir=None, cat=None, coordinates=None, output_basin=None, output_streams=None, output_pour_point=None, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("v.stream.inbasin", input_streams="name", coordinates=east,north)

Parameters

input_streams=name [required]
    Stream network
    Or data source for direct OGR access
input_basins=name
    Subbasins built alongside stream network
    Or data source for direct OGR access
draindir=name
    Drainage directions (needed if exact coordinates used)
    Name of input raster map
cat=string
    Farthest downstream segment category
coordinates=east,north
    Pour point coordinates
    The alogorithm will find the closest stream segment
output_basin=name
    Vector output drainage basin
    Name for output vector map
output_streams=name
    Streams within vector output drainage basin
    Name for output vector map
output_pour_point=name
    Basin outlet
    Name for output vector map
-s
    Snap provided coordinates to nearest segment endpoint
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

input_streams : str, required
    Stream network
    Or data source for direct OGR access
    Used as: input, vector, name
input_basins : str, optional
    Subbasins built alongside stream network
    Or data source for direct OGR access
    Used as: input, vector, name
draindir : str, optional
    Drainage directions (needed if exact coordinates used)
    Name of input raster map
    Used as: input, raster, name
cat : str, optional
    Farthest downstream segment category
coordinates : tuple[float, float] | list[float] | str, optional
    Pour point coordinates
    The alogorithm will find the closest stream segment
    Used as: input, coords, east,north
output_basin : str, optional
    Vector output drainage basin
    Name for output vector map
    Used as: output, vector, name
output_streams : str, optional
    Streams within vector output drainage basin
    Name for output vector map
    Used as: output, vector, name
output_pour_point : str, optional
    Basin outlet
    Name for output vector map
    Used as: output, vector, name
flags : str, optional
    Allowed values: s
    s
        Snap provided coordinates to nearest segment endpoint
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

v.stream.inbasin uses the output of v.stream.network to select only those streams (and sub-basins) that are upstream of (and inclusive of) a selected link in the network. It is used as a step to develop GSFLOW model inputs for a watershed, but need not be exclusively used for that purpose. v.stream.inbasin expects the stream network attributes created by v.stream.network and named using the names v.stream.network uses by default. In other words, v.stream.inbasin will work on the output v.stream.network with default attribute names.

REFERENCES

  • Ng, G.-H. C., A. D. Wickert, R. L. McLaughlin, J. La Frenierre, S. Liess, and L. Sabeeri (2016), Modeling the role of groundwater and vegetation in the hydrological response of tropical glaciated watersheds to climate change, in AGU Fall Meeting Abstracts, H13L–1590, San Francisco, CA.
  • Ng, G-H. Crystal, Andrew D. Wickert, Lauren D. Somers, Leila Saberi, Collin Cronkite-Ratcliff, Richard G. Niswonger, and Jeffrey M. McKenzie. "GSFLOW–GRASS v1. 0.0: GIS-enabled hydrologic modeling of coupled groundwater–surface-water systems." Geoscientific Model Development 11 (2018): 4755-4777. DOI 10.5194/gmd-11-4755-2018

SEE ALSO

v.gsflow.hruparams, v.gsflow.segments, v.stream.network

AUTHOR

Andrew D. Wickert

SOURCE CODE

Available at: v.stream.inbasin source code (history)
Latest change: Friday Feb 21 10:10:05 2025 in commit 7d78fe3