MosaicRule

A class used to define the mosaic rule for mosaicking requested images on the fly.

Property

Type

Description

Ascending

bool

Indicates if sorting in an ascending (TRUE) order or a descending order. This property applies to all mosaic methods where an ordering is defined except "esriMosaicSeamline".

AscendingSpecified

bool

Indicates if Ascending is specified.

FIDs

FIDSet

Defines a selection using a set of raster IDs in a FIDSet. This property applies to all mosaic methods.

LockRasterID

string

As a parameter for the mosaic method "esriMosaicLockRaster", LockRasterID can take a single or a comma delimited list of raster IDs. All those rasters with the given list of raster IDs are selected to participate in the mosaic. An example of the LockRasterID string can be 12,15, 20. The rasters will be visible at all pixel sizes regardless of the minimum and maximum pixel size range of the locked rasters.

MosaicMethod

esriMosaicMethod

The mosaic method, see the list for possible methods.

MosaicOperation

rstMosaicOperatorType

Defines a mosaic operation for resolving overlapping pixels.

MosaicOperationSpecified

bool

Indicates if MosaicOperation is specified.

SortFieldName

string

The name of the attribute field that is used, together with a constant SortValue value, to define the mosaicking order when the MosaicMethod is set to "esriMosaicAttribute". The ordering is defined by the absolute value of the difference between the specified sort field value and the sort base value. For example, the sort field is Month, and the sort value is 7 (July), and the ordering is defined by ABS (Month: 7).

SortValue

object

A constant value defining a reference or base value for the sort field when the MosaicMethod is set to esriMosaicAttribute.

TimeValue

TimeValue

Defines a selection using time.

Viewpoint

Point

As a parameter for the "esriMosaicViewpoint" mosaic method, this property defines a viewpoint location on which the ordering is defined based on the distance from the viewpoint and the nadir of rasters.

WhereClause

string

Defines a selection using a where clause for selecting rasters to be a part of the mosaic. This property applies to all mosaic methods.

Remarks

A mosaic rule contains a mosaic method, its parameters, and a mosaic operation. In general, a mosaic rule is used to specify (1) the selection of rasters to participate in the mosaic; (2) how the selected rasters are ordered; (3) how overlapping pixels at the same location are resolved.

Mosaic operations include:

The supported mosaic methods and the mosaic operators are as follows:

Mosaic Method

Description

Mosaic Operations That Apply (First, Last, Min, Max, Mean, Blend)

esriMosaicAttribute

Sorts rasters based on an attribute field and its difference from a base value.

All (First is default)

esriMosaicCenter

Sorts rasters based on an order where rasters that have their centers closest to the view center or the center of view extent, are placed on top.

All (First is default)

esriMosaicLockRaster

Selects only rasters in a given list of raster IDs to participate in the mosaic. This method takes "LockRasterIDs" as its parameter. The rasters are in a random order. The rasters will be visible at all pixel sizes regardless of the minimum and maximum pixel.

All (First is default)

esriMosaicNadir

Sorts rasters by the distance between the nadir position and view center. This is similar to the "esriMosaicCenter" method but uses the nadir point to a raster, which may be different than the center, especially for oblique imagery.

All (First is default)

esriMosaicNorthwest

Sorts rasters in a view-independent way, where rasters with their centers most northwest are displayed on top.

All (First is default)

esriMosaicSeamline

Cuts the raster using the predefined seamline shape for each raster using optional feathering along the seams. The ordering is predefined during seamline generation.

First (default), Blend

esriMosaicViewpoint

Sorts rasters based on a user-defined view point location and nadir location for the rasters.

All (First is default)

SortValue is only applicable when the field type is numeric or date. A string field can not have SortValue. A date field can use SortValue in one of the following formats:

Examples

C#

//define image server
string url_DEMService = "http://ais3/arcgis/services/testDEM/ImageServer";
testDTED_ImageServer imageSrv = new testDTED_ImageServer();
imageSrv.Url = url_DEMService;
//define image description
GeoImageDescription geoImgDesc = new GeoImageDescription();
geoImgDesc.Height = 600;
geoImgDesc.Width = 800;
geoImgDesc.Interpolation = rstResamplingTypes.RSP_BilinearInterpolation;
ImageServiceInfo isInfo = imageSrv.GetServiceInfo();
geoImgDesc.Extent = isInfo.Extent;

//apply a mosaic rule
MosaicRule mosaicRule = new MosaicRule();
mosaicRule.LockRasterID = "1,2,3";
geoImgDesc.MosaicRule = mosaicRule;

//define export format
ImageType imgType = new ImageType();
imgType.ImageFormat = esriImageFormat.esriImagePNG;
imgType.ImageReturnType = esriImageReturnType.esriImageReturnURL;

//export scaled image
MapImage mapImage = imageSrv.ExportScaledImage(geoImgDesc, imgType);
}

2/28/2020