Skip to content

i.group

Creates, edits, and lists groups of imagery data.

i.group [-rlsg] group=name [subgroup=name] [input=name [,name,...]] [file=name] format=name [--verbose] [--quiet] [--qq] [--ui]

Example:

i.group group=name format=plain

grass.script.parse_command("i.group", group, subgroup=None, input=None, file=None, format="plain", flags=None, verbose=False, quiet=False, superquiet=False)

Example:

gs.parse_command("i.group", group="name", format="json")

Parameters

group=name [required]
    Name of imagery group
subgroup=name
    Name of imagery subgroup
input=name [,name,...]
    Name of raster map(s) to include in group
file=name
    Input file with one raster map name per line
format=name [required]
    Output format
    Allowed values: plain, shell, json
    Default: plain
    plain: Human readable text output
    shell: shell script style text output
    json: JSON (JavaScript Object Notation)
-r
    Remove selected files from specified group or subgroup
-l
    List files from specified (sub)group
-s
    List subgroups from specified group
-g
    Print in shell script style [deprecated]
    This flag is deprecated and will be removed in a future release. Use format=shell instead.
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

group : str, required
    Name of imagery group
    Used as: input, group, name
subgroup : str, optional
    Name of imagery subgroup
    Used as: input, subgroup, name
input : str | list[str], optional
    Name of raster map(s) to include in group
    Used as: input, raster, name
file : str, optional
    Input file with one raster map name per line
    Used as: input, file, name
format : str, required
    Output format
    Used as: name
    Allowed values: plain, shell, json
    plain: Human readable text output
    shell: shell script style text output
    json: JSON (JavaScript Object Notation)
    Default: plain
flags : str, optional
    Allowed values: r, l, s, g
    r
        Remove selected files from specified group or subgroup
    l
        List files from specified (sub)group
    s
        List subgroups from specified group
    g
        Print in shell script style [deprecated]
        This flag is deprecated and will be removed in a future release. Use format=shell instead.
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

i.group allows the user to collect raster map layers in an imagery group by assigning them to user-named subgroups or other groups. This enables the user to run analyses on any combination of the raster map layers in a group. The user creates the groups and subgroups and selects the raster map layers that are to reside in them. Imagery analysis programs like g.gui.gcp, i.rectify, i.ortho.photo and others ask the user for the name of an imagery group whose data are to be analyzed. Imagery analysis programs like i.cluster and i.maxlik ask the user for the imagery group and imagery subgroup whose data are to be analyzed.

NOTES

The i.group options are only available for imagery map layers in the current LOCATION_NAME.

Subgroup names may not contain more than 12 characters.

EXAMPLES

Create a group and subgroup

This example runs in the "landsat" mapset of the North Carolina sample dataset. The following command creates a group and subgroup containing only the visible light bands of Landsat-7:

i.group group=vis_bands subgroup=vis_bands input=lsat7_2000_10,lsat7_2000_20,lsat7_2000_30

List maps from a subgroup

To list maps in the vis_bands subgroup under the vis_bands group:

i.group group=vis_bands subgroup=vis_bands -l

Possible output:

-------------
<lsat7_2000_10@PERMANENT>    <lsat7_2000_20@PERMANENT>    
<lsat7_2000_30@PERMANENT>    
-------------
import grass.script as gs

data = gs.parse_command(
    "i.group", group="vis_bands", subgroup="vis_bands", flags="l", format="json"
)
print(data)

Possible output:

['lsat7_2000_10@PERMANENT', 'lsat7_2000_20@PERMANENT', 'lsat7_2000_30@PERMANENT']

List maps in a group

To list maps in the vis_bands group:

i.group group=vis_bands -l

Possible output:

-------------
<lsat7_2000_10@PERMANENT>    <lsat7_2000_20@PERMANENT>    
<lsat7_2000_30@PERMANENT>    
-------------
import grass.script as gs

data = gs.parse_command("i.group", group="vis_bands", flags="l", format="json")
print(data)

Possible output:

['lsat7_2000_10@PERMANENT', 'lsat7_2000_20@PERMANENT', 'lsat7_2000_30@PERMANENT']

List subgroups in a group

To list subgroups in the vis_bands group:

i.group group=vis_bands -s

Possible output:

-------------
vis_bands    
-------------
import grass.script as gs

data = gs.parse_command("i.group", group="vis_bands", flags="s", format="json")
print(data)

Possible output:

['vis_bands']

SEE ALSO

The GRASS 4 Image Processing manual

g.gui.gcp, i.cluster, i.maxlik, i.rectify, i.ortho.photo

AUTHORS

Michael Shapiro, U.S.Army Construction Engineering Research Laboratory
Parser support: Bob Covill (Tekmap, Canada)

SOURCE CODE

Available at: i.group source code (history)
Latest change: Monday Jun 16 22:35:57 2025 in commit 1bb8b59