Skip to content

i.gcp

Manages Ground Control Points (GCPs) non-interactively.

i.gcp [-lcduibrLB] group=name [image_coordinates=east,north] [target_coordinates=east,north] [status=string] [point=integer [,integer,...]] [--verbose] [--quiet] [--qq] [--ui]

Example:

i.gcp group=name image_coordinates=east,north

grass.script.run_command("i.gcp", group, image_coordinates=None, target_coordinates=None, status="use", point=None, flags=None, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("i.gcp", group="name", image_coordinates=east,north)

Parameters

group=name [required]
    Name of input imagery group
image_coordinates=east,north
    Image coordinates to add
target_coordinates=east,north
    Target coordinates to add
status=string
    Status for new ground control points
    Allowed values: use, ignore
    Default: use
point=integer [,integer,...]
    Point number(s) to manage
    Allowed values: 1-
-l
    List all ground control points
-c
    Clear all ground control points
-d
    Delete selected ground control points
-u
    Use selected ground control points
-i
    Ignore selected ground control points
-b
    Back up the point file
-r
    Restore the backup point file
-L
    List all ground control points in the backup point file
-B
    Remove the backup point file
--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 input imagery group
    Used as: input, group, name
image_coordinates : tuple[float, float] | list[float] | str, optional
    Image coordinates to add
    Used as: input, coords, east,north
target_coordinates : tuple[float, float] | list[float] | str, optional
    Target coordinates to add
    Used as: input, coords, east,north
status : str, optional
    Status for new ground control points
    Allowed values: use, ignore
    Default: use
point : int | list[int] | str, optional
    Point number(s) to manage
    Allowed values: 1-
flags : str, optional
    Allowed values: l, c, d, u, i, b, r, L, B
    l
        List all ground control points
    c
        Clear all ground control points
    d
        Delete selected ground control points
    u
        Use selected ground control points
    i
        Ignore selected ground control points
    b
        Back up the point file
    r
        Restore the backup point file
    L
        List all ground control points in the backup point file
    B
        Remove the backup point file
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.gcp manages Ground Control Points (GCPs) non-interactively.

NOTES

Unlike g.gui.gcp, i.gcp can be invoked from the command line or scripts to manage GCPs. It is recommended to create a backup copy of the original POINTS file using -b before making changes to the file. The backup POINTS file (POINTS_BAK) can be restored using -r or removed later using -B. GCPs in the backup POINTS file can be listed using -L.

EXAMPLES

List all GCPs in group "sar":

i.gcp -l group=sar

Create a backup copy of the current POINTS file:

i.gcp -b group=sar

Clear all GCPs first by removing the POINTS file:

i.gcp -c group=sar

Add new GCPs at the bottom-left and top-right corners of the satellite imagery:

i.gcp group=sar image_coordinates=0,0,31996,32239 target_coordinates=493920,3880490,529470,3916310

Add another GCP that will be ignored for now and list all GCPs:

i.gcp -l group=sar image_coordinates=100,100 target_coordinates=500000,4000000 status=ignore

Use the GCP just added and list all:

i.gcp -u -l group=sar point=3

Delete point 1:

i.gcp -d -l group=sar point=1

Ignore points 1-2:

i.gcp -i -l group=sar point=1-2

List GCPs in the backup POINTS file:

i.gcp -L group=sar

Restore the backup POINTS file:

i.gcp -r group=sar

Remove the backup POINTS file:

i.gcp -B group=sar

SEE ALSO

The GRASS 4 Image Processing manual

i.group, i.target, i.rectify, i.points.auto, Ground Control Points Manager

AUTHOR

Huidae Cho

SOURCE CODE

Available at: i.gcp source code (history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit 53de819