Skip To Content

Compute Class Statistics

  • URL:https://<imageservice-url>/computeClassStatistics
  • Required Capability:Image
  • Version Introduced:10.2

Description

This operation is supported at 10.2 and later.

The computeClassStatistics operation is performed on an image service resource.

This operation is supported by any image service published from a mosaic dataset or a raster dataset.

The result of this operation contains class statistics signatures used by the maximum likelihood classifier.

You can provide arguments to the computeClassStatistics operation as query parameters as defined in the following parameters table:

Request parameters

ParameterDetails
f

The response format. The default response format is html.

Values: html | json

classDescriptions

Required

Description: Class descriptions are training site polygons and their class descriptions. The structure of the geometry is the same as the structure of the JSON geometry objects returned by the API REST de ArcGIS.

Syntax:

{
  "classes":  [  // An array of classes
    {
      "id" : <id>,
      "name" : "<name>",
      "geometry" : <geometry> //polygon
    },
    {
      "id" : <id>,
      "name" : "<name>",
     "geometry" : <geometry>  //polygon
    }
    ...
    ]
}

Examples:

{
  "classes":  [  // An array of classes
    {
      "id" : 1,
      "name" : "class1",
      "geometry" : {"rings": [[[-13555360.4191,5911556.581],[-13489311.5669, 5898227.932],[-13423477.4153,5884426.3329],[-13602646.9571, 5717848.4135], 
[-13587119.9125, 5781976.6214],[-13571360.1713, 5846543.2654],[-13555360.4191, 5911556.581]]]}
    },
    {
      "id" : 2,
      "name" : "class2",
     "geometry" : {"rings": [[[-12555360.4191,5811556.581],[-12489311.5669, 5798227.932],[-12423477.4153,5784426.3329],[-12602646.9571, 5617848.4135], 
[-12587119.9125, 5681976.6214],[-12571360.1713, 5746543.2654],[-12555360.4191, 5811556.581]]]}
    }
    ...
    ]
}

mosaicRule

Description: Specifies the mosaic rule when defining how individual images should be mosaicked. When a mosaic rule is not specified, the default mosaic rule of the image service will be used (as advertised in the root resource: defaultMosaicMethod, mosaicOperator, sortField, sortValue).

See the mosaic rule objects for the JSON syntax and examples.

renderingRule

Description: Specifies the rendering rule for how the requested image should be rendered.

See the raster function objects for the JSON syntax and examples.

pixelSize

Description: The pixel level being used (or the resolution being looked at). If pixel size is not specified, then pixelSize will default to the base resolution of the dataset.

The structure of the pixelSize parameter is the same as the structure of the point object returned by the ArcGIS REST API. In addition to the JSON structure, you can specify the pixel size with a comma-separated syntax.

Syntax:

  • JSON structure: pixelSize={point}
  • Point simple syntax: pixelSize=<x>,<y>

Examples:

  • pixelSize={"x": 0.18, "y": 0.18}
  • pixelSize=0.18,0.18

JSON Response syntax

{"GSG" : "<GSG>"}