Classification objects

Overview

This topic discusses the JSON representation of 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:

  • Class Breaks
  • Unique Value

Class Breaks

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  "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>
}

Keep in mind the following for the properties above:

  • The type property for class breaks classification is classBreaksDef.
  • The normalizationType and normalizationField properties can be used to normalize class breaks. These properties are optional.
  • The optional properties, baseSymbol and colorRamp, can be used to include a symbol with varying color for each class.
    • If onlybaseSymbol is defined, a default color ramp is used to assign a color for each class.
    • If only colorRamp is defined, a default symbol is created based on geometryType of the feature class, and the colorRamp is used to assign color to the symbol for each class.
    • If baseSymbol and colorRamp are missing, the map server assumes default values for these properties and returns the results with an appropriate symbol and color.
  • When classificationMethod is esriClassifyStandardDeviation, use standardDeviationInterval to specify the interval size. When done this way, breakCount is ignored.

Unique value

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

1
2
3
4
5
6
7
8
{
  "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>
}

Keep in mind the following for the properties above:

  • The type property for unique value classification is uniqueValueDef.
  • The optional properties, baseSymbol and colorRamp, can be used to include a symbol with varying color for each class.
    • If only baseSymbol is defined, a default color ramp is used to assign a color for each class.
    • If only colorRamp is defined, a default symbol is created based on geometryType of the feature class, and the colorRamp is used to assign color to the symbol for each class.
    • If baseSymbol and colorRamp are missing, the map server assumes default values for these properties and returns the results with an appropriate symbol and color.

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

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close