STITCH
Stitch Image Tiles
Description
Some satellite imagery can be provided in different tiles with orbital data information for each tile. STITCH lets you merge individual tiles that are obtained from the same orbit on the same day, into one complete scene. If the input files are PIX files with ORBIT segments, this program will rebuild a new orbital data for the whole strip to maintain the ephemeris information. If the input files are TIF/NITF files with RPC, this program will rebuild a new RPC for the whole strip. Having a single scene simplifies math modeling, orthorectification, mosaicking, and other image post-processing.
Parameters
stitch(mfile, filo)
| Name |
Type |
Caption |
Length |
Value range |
| MFILE * |
str |
Input file name, directory, or text file |
1 - 192 |
|
| FILO * |
str |
Output file name |
1 - 192 |
|
* Required parameter
Parameter descriptions
MFILE
Specifies the name of a folder, image file, or text file that contains the images to be stitched
into one scene. Wildcards (*) can be used.
MFILE can be set using any of the following options:
- a specific data file name or directory path and file name; for example, "irvine.pix" or "c:\data\irvine.pix"
- a specific file name pattern or all of the files in a folder; for example, "c:\data\*.pix" or "c:\data"
- an existing text file that contains references to multiple files with, optionally, different parameter settings on a per file basis; for example, "c:\list.txt"
If a wildcard character (*) is used, the list of files that match the format and specified naming convention are processed with the set parameters. If MFILE specifies a folder name, all recognized image files are processed using the set parameters. If a text file is specified for MFILE, the files and parameters listed in the text file are used.
If the text file option is used, the following general rules apply:
- Specify a .txt extension for the file containing multiple files and different parameter values.
- List each set of parameters on its own line in the given order.
- Specify string parameters within quotation marks.
- Do not specify numeric parameters within quotation marks.
- A quotation mark preceded by a backslash is used as part of the string. For example, 'ab\"c' is used as: ab"c.
- Use an exclamation mark (!) before writing a comment in the text file.
- Use semi-colons to delimit the parameters.
- Leave the position between the semi-colons empty (";;") if you do not want to specify a value. Alternatively, if there are no
remaining parameters to be specified on the end of a line, you may leave it blank.
- Parameters in a text file may or may not be specified in the function:
- If a parameter is specified in the function and in the text file, the value provided in the text file is used.
- If a parameter is not specified in the text file, the parameter can be set in the function.
FILO
Specifies the output PCIDSK file that will contain the stitched images. If the specified file already exists, it will be overwritten.
Return Value
Returns: 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.
|
Details
STITCH lets you stitch ASTER, IKONOS, QuickBird, Worldview and SPOT image tiles acquired on the same day in a single pass of a satellite. This program supports PIX files with ORBIT segments or TIF/NITF files with RPC. A new orbit segment or RPC segment for the whole strip will be created.
The following data types are supported:
- ASTER (Level 1A data)
- IKONOS (GEO and GEO Ortho Kit products)
- SPOT (Level 1A data)
- QuickBird/WorldView (Basic 1B product)
Example
Stitch all the files that fall into the scene*.pix list and generate an output file named stitched_scene.pix.
from pci.stitch import stitch
mfile="scene*.pix"
filo="stitched_scene.pix"
stitch(mfile, filo)
© PCI Geomatics Enterprises, Inc.®,
2026. All rights reserved.