Skip to content

i.wi

Calculates different types of water indices.

i.wi winame=type [blue=name] [green=name] [red=name] [nir=name] [band5=name] [band7=name] output=name [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

i.wi winame=lswi output=name

grass.script.run_command("i.wi", winame="lswi", blue=None, green=None, red=None, nir=None, band5=None, band7=None, output, overwrite=None, verbose=None, quiet=None, superquiet=None)

Example:

gs.run_command("i.wi", winame="lswi", output="name")

grass.tools.Tools.i_wi(winame="lswi", blue=None, green=None, red=None, nir=None, band5=None, band7=None, output, overwrite=None, verbose=None, quiet=None, superquiet=None)

Example:

tools = Tools()
tools.i_wi(winame="lswi", output="name")

This grass.tools API is experimental in version 8.5 and expected to be stable in version 8.6.

Parameters

winame=type [required]
    Type of water index
    Allowed values: awei_ns, awei_s, lswi, ndwi_mf, ndwi_x, tcw, wi
    Default: lswi
    awei_ns: Automated Water Extraction Index - No Shadow
    awei_s: Automated Water Extraction Index - Shadow
    lswi: Land Soil Water Index
    ndwi_mf: Normalized Difference Water Index - Mc Feeters
    ndwi_x: Normalized Difference Water Index - Xu
    tcw: Tasseled Cap Water
    wi: Water Index
blue=name
    Name of input blue channel surface reflectance map
    Range: [0.0;1.0]
green=name
    Name of input green channel surface reflectance map
    Range: [0.0;1.0]
red=name
    Name of input red channel surface reflectance map
    Range: [0.0;1.0]
nir=name
    Name of input nir channel surface reflectance map
    Range: [0.0;1.0]
band5=name
    Name of input 5th channel surface reflectance map
    Range: [0.0;1.0]
band7=name
    Name of input 7th channel surface reflectance map
    Range: [0.0;1.0]
output=name [required]
    Name of the output wi layer
--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

winame : str, required
    Type of water index
    Used as: type
    Allowed values: awei_ns, awei_s, lswi, ndwi_mf, ndwi_x, tcw, wi
    awei_ns: Automated Water Extraction Index - No Shadow
    awei_s: Automated Water Extraction Index - Shadow
    lswi: Land Soil Water Index
    ndwi_mf: Normalized Difference Water Index - Mc Feeters
    ndwi_x: Normalized Difference Water Index - Xu
    tcw: Tasseled Cap Water
    wi: Water Index
    Default: lswi
blue : str, optional
    Name of input blue channel surface reflectance map
    Range: [0.0;1.0]
    Used as: input, raster, name
green : str, optional
    Name of input green channel surface reflectance map
    Range: [0.0;1.0]
    Used as: input, raster, name
red : str, optional
    Name of input red channel surface reflectance map
    Range: [0.0;1.0]
    Used as: input, raster, name
nir : str, optional
    Name of input nir channel surface reflectance map
    Range: [0.0;1.0]
    Used as: input, raster, name
band5 : str, optional
    Name of input 5th channel surface reflectance map
    Range: [0.0;1.0]
    Used as: input, raster, name
band7 : str, optional
    Name of input 7th channel surface reflectance map
    Range: [0.0;1.0]
    Used as: input, raster, name
output : str, required
    Name of the output wi layer
    Used as: output, raster, name
overwrite : bool, optional
    Allow output files to overwrite existing files
    Default: None
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

winame : str, required
    Type of water index
    Used as: type
    Allowed values: awei_ns, awei_s, lswi, ndwi_mf, ndwi_x, tcw, wi
    awei_ns: Automated Water Extraction Index - No Shadow
    awei_s: Automated Water Extraction Index - Shadow
    lswi: Land Soil Water Index
    ndwi_mf: Normalized Difference Water Index - Mc Feeters
    ndwi_x: Normalized Difference Water Index - Xu
    tcw: Tasseled Cap Water
    wi: Water Index
    Default: lswi
blue : str | np.ndarray, optional
    Name of input blue channel surface reflectance map
    Range: [0.0;1.0]
    Used as: input, raster, name
green : str | np.ndarray, optional
    Name of input green channel surface reflectance map
    Range: [0.0;1.0]
    Used as: input, raster, name
red : str | np.ndarray, optional
    Name of input red channel surface reflectance map
    Range: [0.0;1.0]
    Used as: input, raster, name
nir : str | np.ndarray, optional
    Name of input nir channel surface reflectance map
    Range: [0.0;1.0]
    Used as: input, raster, name
band5 : str | np.ndarray, optional
    Name of input 5th channel surface reflectance map
    Range: [0.0;1.0]
    Used as: input, raster, name
band7 : str | np.ndarray, optional
    Name of input 7th channel surface reflectance map
    Range: [0.0;1.0]
    Used as: input, raster, name
output : str | type(np.ndarray) | type(np.array) | type(gs.array.array), required
    Name of the output wi layer
    Used as: output, raster, name
overwrite : bool, optional
    Allow output files to overwrite existing files
    Default: None
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

Returns:

result : grass.tools.support.ToolResult | np.ndarray | tuple[np.ndarray] | None
If the tool produces text as standard output, a ToolResult object will be returned. Otherwise, None will be returned. If an array type (e.g., np.ndarray) is used for one of the raster outputs, the result will be an array and will have the shape corresponding to the computational region. If an array type is used for more than one raster output, the result will be a tuple of arrays.

DESCRIPTION

i.wi calculates water indices based on biophysical parameters.

  • AWEI: Automated Water Extraction Index (2 versions: no shadow or shadow
  • LSWI: Land Surface Water Index
  • NDWI: Normalized Difference Water Index (2 versions: McFeeters or Xu)
  • TCW: Tasseled Cap Water
  • WI: Water Index

NOTES

Requirements (as of Landsat 5TM bands)

  • awei_noshadow needs greenchan, nirchan, chan5chan
  • awei_shadow needs bluechan, greenchan, nirchan, chan5chan, chan7chan
  • ls_wi needs nirchan, chan7chan
  • ndwi_mcfeeters needs greenchan, nirchan
  • ndwi_xu needs greenchan, chan5chan
  • tcw needs bluechan, greenchan, redchan, nirchan, chan5chan, chan7chan
  • wi needs greenchan, redchan, nirchan, chan5chan, chan7chan

TODO

Find other water indices and add them.

REFERENCES

AWEI: Automated Water Extraction Index
Feyisa, G.L., Meilby, H., Fensholt, R., Proud, S.R. (2014). Automated Water Extraction Index: A new technique for surface water mapping using Landsat imagery. Remote Sensing of Environment, 140, 23-35. https://doi.org/10.1016/j.rse.2013.08.029.

LSWI: Land Surface Water Index
a kind of Normalized Difference Water Index Xiao X., Boles S., Frolking S., Salas W., Moore B., Li C., et al. (2002) Landscape-scale characterization of cropland in China using vegetation and Landsat TM images. International Journal of Remote Sensing, 23:3579-3594.

NDWI McFeeters
McFeeters, S.K. (1996). The use of the Normalized Difference Water Index (NDWI) in the delineation of open water features. International Journal of Remote Sensing, 17, 1425-1432. https://doi.org/10.1080/01431169608948714.

NDWI Xu
Xu, H. (2006). Modification of normalised difference water index (NDWI) to enhance open water features in remotely sensed imagery. International Journal of Remote Sensing, 27, 3025-3033. https://doi.org/10.1080/01431160600589179.

TCW
Crist, E.P. (1985). A TM tasseled cap equivalent transformation for reflectance factor data. Remote Sensing of Environment, 17, 301-306.

WI
Fisher, A., Flood, N., Danaher, T. (2016). Comparing Landsat water index methods for automated water classification in eastern Australia. Remote Sensing of Environment, 175, 167-182. ISSN 0034-4257, https://doi.org/10.1016/j.rse.2015.12.055.

SEE ALSO

i.vi

AUTHOR

Yann Chemin

SOURCE CODE

Available at: i.wi source code (history)
Latest change: Friday Feb 21 12:27:42 2025 in commit 8fce680