Classification objects

Overview

This is supported at ArcGIS 10.1 and later.

This topic discusses JSON classification definition objects. The classification definition optionally allows specifying symbology that returns a complete renderer object. It also includes an optional colorRamp object that's used to assign a unique color to each symbol.

The following classification definitions are discussed here:

Class breaks

Use the class breaks classification scheme to group values into classes.

Note the following about optional parameters:

The type property for class breaks classification is classBreaksDef.

JSON syntax

{
  "type": "classBreaksDef",
  "classificationField": "<field name>",
  "classificationMethod": "<esriClassifyNaturalBreaks | esriClassifyEqualInterval | esriClassifyQuantile | 
				esriClassifyStandardDeviation | esriClassifyGeometricalInterval>",
  "breakCount": <count>,
  "standardDeviationInterval": < 1 | 0.5 | 0.33 | 0.25 >, //use when classificationMethod is esriClassifyStandardDeviation.
  
  //optional. use to normalize class breaks
  "normalizationType": "<esriNormalizeByField | esriNormalizeByLog | esriNormalizeByPercentOfTotal>",
  "normalizationField": "<field name>", //use when normalizationType is esriNormalizeByField
  
  //optional. use to define symbol for classes
  "baseSymbol": <symbol>,
  "colorRamp": <colorRamp>
}

JSON example

{
  "type": "classBreaksDef",
  "classificationField": "POP2010",
  "classificationMethod": "esriClassifyNaturalBreaks",
  "breakCount": 5,
  "normalizationType": "esriNormalizeByField",
  "normalizationField": "Area"
}

Unique value

Use the unique value classification scheme to group values based on a unique combination of one or more (up to three) fields.

Note the following about optional parameters:

The type property for unique value classification is uniqueValueDef.

JSON syntax

{
  "type": "uniqueValueDef",
  "uniqueValueFields": ["<field name 1 >","<field name 2>","<field name 3>"],
  "fieldDelimiter": "field_delimiter_character",
  
  //optional. use to define symbol for unique values
  "baseSymbol": <symbol>,
  "colorRamp": <colorRamp>
}

JSON example

//uniqueValue classification definition with symbology
{
  "type": "uniqueValueDef",
  "uniqueValueFields": ["Type", "AdminClass"],
  "fieldDelimiter": ",",
  "baseSymbol":
  {
    "type": "esriSLS",
    "style": "esriSLSSolid",
    "width": 2
  }
  "colorRamp":
  {
    "type": "algorithmic",
    "fromColor": [115,76,0,255],
    "toColor": [255,25,86,255],
    "algorithm": "esriHSVAlgorithm"
  }
}

3/3/2017