GCPWRIT

Write GCPs to a text file


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Return Value :: Details :: Example :: Related

Back to top

Description


The GCPWRIT algorithm reads ground control points (GCP) from a specified GCP segment or layer and writes the GCP coordinates to a text file.
Back to top

Parameters


gcpwrit(file, dbgc, tfile, gcpform, dmsform)

Name Type Caption Length Value range
FILE * str File name of input image 1 -    
DBGC * List[int] Input GCP segment or layer 1 - 1  
TFILE * str Output text file 1 -    
GCPFORM * str Format of GCP data 1 - 64 2D, 2DERR, 3D, 3DERR, BULK
Default: 3D
DMSFORM str Degrees-minutes-seconds (DMS) format of longitude and latitude 0 - 3 ON, OFF
Default: OFF

* Required parameter
Back to top

Parameter descriptions

FILE

The name of the PCIDSK file that contains the GCP segment from which to read the GCP data.

DBGC

The input GCP layer or segment to read.

TFILE

The path and file name of the output text file to which to write the GCP coordinates.

For more information on the required format for the text file, see the description of the GCP format (GCPFORM) parameter.

Important: A file with the same name must not exist in the folder you specify.

GCPFORM

The code for the format of the input GCP data.

The codes are described as follows:

where:

DMSFORM

Whether the output coordinates of longitude and latitude use real numbers or degrees/minutes/seconds/hemisphere strings.

This parameter is ignored if vector units are not LONG/LAT.

The DMS format for latitude and longitude is as follows:

where N, S, E, and W stand for the north, south, east, and west hemispheres, respectively.

For example:

latitude: 34d01'15.1104"N
longitude: 118d14'14.2080"W
Note: When the latitude and longitude values are written as floating-point numbers, the unit is degrees. A positive (negative) latitude is in the northern (southern) hemisphere, and a positive (negative) longitude is in the eastern (western) hemisphere.
Back to top

Return Value

Returns: program execution status

Type:  PCI_INT

The return value is 0. This function returns only if it executes successfully; otherwise, it throws an exception instead of returning.

Back to top

Details

The GCPWRIT algorithm writes GCP data from a specified GCP segment or layer to a text file. The GCP data may include check-point data. To specify the format of the GCP data in the output text file, you use the GCP format (GCPFORM) and Deg/Min/Sec format (DMSFORM) parameters.

A GCP may be intended for use with georeferencing control (a "true GCP"), or it may be intended for use in assessing the accuracy of a rectification result (a "check point" or a "check-point GCP"). The data written to the output text file includes a flag value (S) that distinguishes between the two.

Back to top

Example

Read GCP data from GCP segment 27 in the file "irvine.pix" and write the data to the newly created file "gcp.txt" in format "2D". Latitude and longitude values will be written as signed floating-point numbers.

from pci.gcpwrit import gcpwrit

file = 'irvine.pix'
dbgc = [27]
tfile = 'gcp.txt'
gcpform = '2D'
dmsform = ''

gcpwrit(file, dbgc, tfile, gcpform, dmsform)

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.