MOSRUN

Create a mosaic


EnvironmentsPYTHON :: EASI
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Related

Back to top

Description


The MOSRUN algorithm creates a continuous mosaic from the input mosaic project and, optionally, a tiling scheme you specify. The scheme can either be that defined in CATALYST Professional Mosaic Tool or be the mosaic-definition file created by the MOSDEF algorithm. Based on the cutlines, MOSRUN determines the data to add to the mosaic. Radiometric correction and color-balancing coefficients are applied, as defined in Mosaic Tool or by MOSPREP, and the images are then added to the output mosaic.
Back to top

Parameters


mosrun(silfile, mdfile, outdir, tilist, crsrcmap, extirule, delempti, proc, resample)

Name Type Caption Length Value range
SILFILE * str Source-image list file 1 -    
MDFILE str Mosaic-definition file 0 -    
OUTDIR str Output folder 0 -    
TILIST str List of subset tiles 0 -    
CRSRCMAP str Create output source map 0 - 3 YES | NO
Default: NO
EXTIRULE str Rule for processing existing tiles 0 - 6 SKIP | REGEN | UPDATE
Default: SKIP
DELEMPTI str Delete empty tiles 0 - 4 NONE | NEW
Default: NONE
PROC str Memory use of algorithm 0 -  
RESAMPLE str Resampling method to use 0 - 5 NEAR | BILIN | CUBIC
Default: CUBIC

* Required parameter
Back to top

Parameter descriptions

SILFILE

The name of an existing source-image list file created by the MOSPREP algorithm or a mosaic project created by CATALYST Professional Mosaic Tool. The file identifies the input images, and the specified order thereof, from which to create the mosaic. The file can also define the map projection, pixel size, mosaic extents, and other characteristics; however, the settings may be overridden by a mosaic-definition file created by MOSDEF.

MDFILE

The name of a mosaic-definition file created in XML format by MOSDEF. The file contains or references the layout necessary to create a mosaic.

Note: If you have defined the output mosaic in Mosaic Tool, you need not specify a value for this parameter. However, if the output mosaic has been defined in both Mosaic Tool and in MOSDEF, the mosaic-definition file specified herein will be used.

This parameter is optional.

OUTDIR

The name of an existing folder to which to write the tiles created. Tiles are named and written to the folder according to the value of TILEID in the mosaic-definition file. If a tile ID from the tile-definition polygon layer includes a path, the output folder is appended with the path name. If the tile ID includes a full-absolute path, the path is used as the file-naming convention for the output folder, superseding the value of the OUTDIR parameter for that tile. By default, the mosaic results are stored in the active working folder.

This parameter is optional.

TILIST

A string or text file of tiles to process.

After running successfully, MOSDEF creates a mosaic-definition file in XML format, which you use as input for the MDFILE parameter. The file references a list of tiles (TileDefFile) and corresponding tile IDs.

The value of this parameter is a comma-separated subset of the tiles listed in the tile-definition vector-polygon file (TileDefFile). You specify each tile by its tile ID.

For example:
TILIST = "1_1, 1_2"
When you specify a text file for this parameter, each line in the file must contain a single identifier. For example, consider a tile-definition vector-polygon file of the world (Global_DEM_tilepoly.pix) that has tile IDs ranging from 1_1 through 20_15 (18-by-12 degree tiles). To mosaic only the tiles for Brazil, type the following tile IDs in a text file, as follows:
7_8
8_8
9_8
7_9
8_9
9_9
7_10
8_10
7_11
8_11

You then specify the text file as input for this parameter

If you do not specify a value for this parameter, all tiles are processed by default.

This parameter is optional.

CRSRCMAP

Whether to create a source map when the mosaic is created. A source map is a polygon layer created and stored in a separate file that contains an attribute to identify the predominant, source-input image used for each pixel in the output mosaic. As images are added to the mosaic, each source image is recorded in a separate raster, which, at the end of the process, is converted to a polygon layer.

The polygon layer has the following attributes (fields):

If you do not specify a value for this parameter, a source map is not created. When you specify YES, a source map is created in a separate file. The name of the file is based on the mosaic-definition file specified and appended with *_SourceMap.

This parameter is optional.

EXTIRULE

The rule to apply to process existing tiles. The rule defines how processing occurs when an output tile exists already.

You can select from the following options, which you can specify as a keyword:

This parameter is optional.

DELEMPTI

Whether to delete empty tiles. A tile is considered empty when all pixels in it have the value defined as NoData. Deleting empty tiles is the final step in the MOSRUN process.

You can enter one of the following keywords to determine how empty tiles are deleted:

This parameter is optional.

PROC

The amount of memory (in megabytes) for the algorithm to use during processing.

If you do not specify a limit for the host memory, a default of 1 GB or half the available physical memory, whichever is smaller, is applied.

RESAMPLE

The resampling method to use during orthorectification.

The following methods are supported:
Back to top

Details

The MOSRUN algorithm creates a continuous mosaic from the specified source images and tiling scheme.

When you are satisfied with the mosaic preview, you can process a subset of mosaic tiles and, if the quality is satisfactory, process the next subset, and so on.

After running successfully, MOSRUN creates one or more raster files from the files created by MOSPREP and MOSDEF or a mosaic project created by CATALYST Professional Mosaic Tool. When the value of CRSRCMAP is YES, MOSRUN creates a PCIDSK file of the source map.

MOSRUN creates the following files:

Back to top

Example

The following example creates a mosaic tile or tiles based on the information in the source-image list and mosaic-definition file.

from pci.mosrun import mosrun


silfile         = "Halifax/Halifax.mos"  # Mosaic project created by MOSPREP
mdfile          = "Halifax/Neighborhoods_def.xml" #  Mosaic-definition file created by MOSDEF
outdir          =   "Halifax/mosaic"    # output folder
tilist          =   ""  # all tiles defined in MDFILE are created
crsrcmap        =   ""  # default, no source map is created
extirule        =   ""  # default, skip existing tiles
delempti        =   ""  # default, no tiles are deleted
proc            =   ""  # default, use maximum available memory
resample        =   ""  # default, cubic convolution resampling

mosrun(silfile, mdfile, outdir, tilist, crsrcmap, extirule, delempti, proc, resample)

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