| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Return Value :: Details :: Examples |
| Back to top |
| Back to top |
gcpimport(oeproji, mfile, dbgc, image_id, oeprojo)
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| OEPROJI * | str | Input OrthoEngine project file | 1 - | |
| MFILE * | str | Input file name, directory, or text file | 1 - | |
| DBGC | List[int] | Input Ground Control Points segment or layer | 0 - 1 | |
| IMAGE_ID | str | Image ID | 0 - | |
| OEPROJO | str | Output OrthoEngine project file | 0 - |
| Back to top |
OEPROJI
Specifies the path and file name of the input OrthoEngine project file into which GCPs will be added.
MFILE
Specifies the name of a folder, image file(s), or text file that contains the input images with the GCP segment. Wildcards (*) can be used.
DBGC
Specifies the input GCP segment to import into the input OrthoEngine project along with the image layers.
If a directory or file name pattern is specified for MFILE, this segment number is applied to all images. If a text file is specified for MFILE, DBGC is read from the text file. This segment number is applied to all entries in the text file that omit the DBGC.
If DBGC is left blank then the last GCP segment is read from the image file.
IMAGE_ID
Specifies the image identification name in the input project file into which the GCPs are imported.
The image identification name is typically the image base name when an OrthoEngine project is created. For example, when you add an image from "C:\pci\Demo\S129.pix" to a project, the image identification is set to "S129". However, if you set this parameter with a file name extension and its full path, the base name is automatically extracted; therefore, "C:\pci\Demo\S129.pix" and "S129" are both accepted.
The following formats are acceptable:
If a directory or file name pattern is specified for MFILE, this parameter can be empty; the file names are extracted and then used as the Image IDs.
If a text file is specified for MFILE, the image IDs are read from the text file; or the file names are extracted and then used as the Image IDs.
OEPROJO
Specifies the path and file name of the output OrthoEngine project file that contains the imported GCPs. If not specified, this parameter uses OEPROJI (InputText) by default.
If specified the output OrthoEngine project file must not exist.
| Back to top |
Returns: execution status
Type: PCI_INT
The return value is 0.
This function returns only if it executes successfully; otherwise, it throws an exception.
| Back to top |
GCPIMPORT imports ground control points (GCP) to an OrthoEngine project file (.prj). Each GCP in a project has a unique identifier referred to as a GCP ID. If the ID of the incoming point exists already in the project, and its geocoded x and y position is the same as an existing GCP, it will be imported and read as a stereo GCP. If the geocoding position differs, the point will still be imported, but the ID will be made unique by appending a sequential number, for example, G001_1.
The GCP segment's elevation datum must match the input OrthoEngine project's elevation datum, except if there are no GCPs in the project, in which case the project's elevation datum is set to the same as the GCP segment's.
Any GCP segment that cannot be imported is skipped and the reason is written to the report.
This function is equivalent to manually collecting GCPs for the working image in OrthoEngine, where you import GCPs from a text file, browse to a PCIDSK file, and select a GCP segment.
| Back to top |
This example imports GCP segment 3 from the S129.pix file into the OrthoEngine project, airphoto.prj. The GCPs are assigned to the image with the image ID S129. In the example, the original project is updated because the output project file is not specified.
from pci.gcpimport import gcpimport oeproji = "air_photo.prj" mfile = "s129.pix" dbgc = [3] image_id = "s129" oeprojo = "" gcpimport( oeproji, mfile, dbgc, image_id, oeprojo )
This example imports GCP segments from the images specified in a text file images.txt into the OrthoEngine project, airphoto.prj. In the example, the original project is updated because the output project file is not specified.
from pci.gcpimport import gcpimport oeproji = "air_photo.prj" mfile = "images.txt" dbgc = [] image_id = "" oeprojo = "" gcpimport( oeproji, mfile, dbgc, image_id, oeprojo )
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.