Mosaic rule objects

Overview

This topic discusses the JSON representation of mosaic rule objects. Image service uses a mosaic rule to mosaic multiple rasters on-the-fly. The mosaic rule parameter is used by many image service operations, for example, Export Image and Identify operations.

A mosaic rule is used to specify the following:

  • Selection of rasters to participate in the mosaic.
  • How selected rasters are ordered.
  • How overlapping pixels at the same location are resolved.

The image service has a list of allowed mosaic methods:

  • esriMosaicNone
  • esriMosaicCenter
  • esriMosaicNorthwest
  • esriMosaicNadir
  • esriMosaicViewpoint
  • esriMosaicAttribute
  • esriMosaicLockRaster
  • esriMosaicSeamline

None

Orders rasters based on the order (ObjectID) in the mosaic dataset attribute table. Mosaic results are view-independent.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
{
  "mosaicMethod": "esriMosaicNone", //required
  "where": "<where>", //optional
  "ascending": <true | false>,//optional, default is true
  "fids": [<fid1>, <fid2>],//optional
  "mosaicOperation": "<MT_FIRST | MT_LAST | MT_MIN | MT_MAX | MT_MEAN | MT_BLEND | MT_SUM>" //default is MT_FIRST
}

Center

Orders rasters based on the distance between their centers and the view center. Mosaic results are view-dependent.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
{
  "mosaicMethod": "esriMosaicNone", //required
  "where": "<where>", //optional
  "ascending": <true | false>,//optional, default is true
  "fids": [<fid1>, <fid2>],//optional
  "mosaicOperation": "<MT_FIRST | MT_LAST | MT_MIN | MT_MAX | MT_MEAN | MT_BLEND | MT_SUM>" //default is MT_FIRST
}

NorthWest

Orders rasters based on the distance between their centers and the northwest point of the service. Mosaic results are view-independent.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
{
  "mosaicMethod": "esriMosaicNorthwest", //required
  "where": "<where>", //optional
  "ascending": <true | false>,//optional, default is true
  "fids": [<fid1>, <fid2>],//optional
  "mosaicOperation": "<MT_FIRST | MT_LAST | MT_MIN | MT_MAX | MT_MEAN | MT_BLEND | MT_SUM>" //default is MT_FIRST
}

Nadir

Orders rasters based on the distance between their nadir position and view center. Mosaic results are view-dependent.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
{
  "mosaicMethod": "esriMosaicNadir", //required
  "where": "<where>", //optional
  "ascending": <true | false>,//optional, default is true
  "fids": [<fid1>, <fid2>],//optional
  "mosaicOperation": "<MT_FIRST | MT_LAST | MT_MIN | MT_MAX | MT_MEAN | MT_BLEND | MT_SUM>" //default is MT_FIRST
}

Viewpoint

Orders rasters based on the distance between their centers and a user defined view point. Mosaic results are view-independent.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
  "mosaicMethod": "esriMosaicViewpoint", //required
  "viewpoint": <point>,//required
  "where": "<where>", //optional
  "ascending": <true | false>,//optional, default is true
  "fids": [<fid1>, <fid2>],//optional
  "mosaicOperation": "<MT_FIRST | MT_LAST | MT_MIN | MT_MAX | MT_MEAN | MT_BLEND | MT_SUM>" //default is MT_FIRST
}

ByAttribute

Orders rasters based on the absolute distance between their values of an attribute and a base value. Only numeric or date fields are applicable. Mosaic results are view-independent.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "mosaicMethod": "esriMosaicAttribute", //required
  "sortField": "<sortFieldName>",//required, numeric or date fields only.
  "sortValue": <sortValue>,//optional, default is null or 0. Use numeric values for numeric fields and use the following string format for date field:
      yyyy/MM/dd HH:mm:ss.s
      yyyy/MM/dd HH:mm:ss
      yyyy/MM/dd HH:mm
      yyyy/MM/dd HH
      yyyy/MM/dd
      yyyy/MM
      yyyy
  "ascending": <true | false>,//optional, default is true
  "where": "<where>", //optional
  "fids": [<fid1>, <fid2>],//optional
  "mosaicOperation": "<MT_FIRST | MT_BLEND | MT_SUM>" //default is MT_FIRST
}

LockRaster

Displays only the selected rasters. Mosaic results are view-independent.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
  "mosaicMethod": "esriMosaicLockRaster", //required
  "lockRasterIds": [<rasterId1>, <rasterId2>],  //required
  "where": "<where>", //optional
  "ascending": <true | false>,//optional, default is true
  "fids": [<fid1>, <fid2>],//optional
  "mosaicOperation": "<MT_FIRST | MT_LAST | MT_MIN | MT_MAX | MT_MEAN | MT_BLEND | MT_SUM>" //default is MT_FIRST
}

Seamline

Orders rasters based on the predefined seamline. The ascending property is defined by the seamline so is not applicable anymore. Only two mosaic operations are applicable as listed below. Mosaic results are view-independent.

Use dark colors for code blocksCopy
1
2
3
4
5
6
{
  "mosaicMethod": "esriMosaicSeamline", //required
  "where": "<where>", //optional
  "fids": [<fid1>, <fid2>],//optional
  "mosaicOperation": "<MT_FIRST | MT_BLEND>" //default is MT_FIRST
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.