- URL:
- https://<layer-url>/generateRenderer
- Methods:
- GET
- Required Capability:
- Map
- Version Introduced:
- 10.1
Description
generate  operation is performed on a  layer / table resource. This operation groups data using the supplied classification  (classification definition) and an optional where  clause. The result is a renderer object. Use base  and color  to define the symbols assigned to each class. If the operation is performned on a table, the result is a renderer object containing the data classes and no symbols.
You can provide arguments to the generate  operation as query parameters defined in the parameters table below.
Request Parameters
| Parameter | Details | 
|---|---|
| 
 | Description: The response format. The default response format is html. Values: html | json | 
| 
 | Description: The definition using which the parameter is generated. Example:  | 
| 
 | Description: A where clause for which the data needs to be classified. Any legal SQL where clause operation on the fields in the layer/table is allowed. Example:  | 
| 
 | Description: GeoDatabase version to query. This parameter applies only if  Syntax:  Example:  | 
Example Usage
Example 1: Generate Renderer using a unique value classification definition, when baseSymbol is missing then map server would assign an appropriate baseSymbol:
Example 2: Generate Renderer using a class breaks classification definition:
JSON Response Syntax (when classificationDef type is uniqueValueDef)
{
  "type" : "uniqueValue",
  "field1" : "<field1>",
  "field2" : "<field2>",
  "field3" : "<field3>",
  "fieldDelimiter" : "<fieldDelimiter>",
  "defaultSymbol" :  <symbol>,
  "defaultLabel" : "<defaultLabel>",
  "uniqueValueInfos" : [
    {
      "value" : "<value1>",
      "count" : "<number of features with value1>",
      "label" : "<label1>",
      "description" : "<description1>",
      "symbol" :  <symbol1>
    },
    {
      "value" : "<value2>",
      "count" : "<number of features with value2>",
      "label" : "<label2>",
      "description" : "<description2>",
      "symbol" :  <symbol2>
    }
  ]
}JSON Response Example (when classificationDef type is uniqueValueDef)
{
 "type": "uniqueValue",
 "field1": "sub_region",
 "field2": "",
 "field3": "",
 "fieldDelimiter": ", ",
 "defaultSymbol": {
  "type": "esriSFS",
  "style": "esriSFSSolid",
  "color": [
   110,
   110,
   110,
   255
  ],
  "outline": {
   "type": "esriSLS",
   "style": "esriSLSSolid",
   "color": [
    0,
    0,
    0,
    255
   ],
   "width": 1
  }
 },
 "defaultLabel": "\u003call other values\u003e",
 "uniqueValueInfos": [
  {
   "value": "East North Central",
   "count": 5,
   "label": "East North Central",
   "description": "",
   "symbol": {
    "type": "esriSFS",
    "style": "esriSFSSolid",
    "outline": {
     "type": "esriSLS",
     "style": "esriSLSSolid",
     "color": [
      0,
      0,
      0,
      255
     ],
     "width": 1
    },
    "color": [
     115,
     77,
     0,
     255
    ]
   }
  },
  {
   "value": "East South Central",
   "count": 4,
   "label": "East South Central",
   "description": "",
   "symbol": {
    "type": "esriSFS",
    "style": "esriSFSSolid",
    "outline": {
     "type": "esriSLS",
     "style": "esriSLSSolid",
     "color": [
      0,
      0,
      0,
      255
     ],
     "width": 1
    },
    "color": [
     92,
     130,
     3,
     255
    ]
   }
  },
  {
   "value": "Middle Atlantic",
   "count": 3,
   "label": "Middle Atlantic",
   "description": "",
   "symbol": {
    "type": "esriSFS",
    "style": "esriSFSSolid",
    "outline": {
     "type": "esriSLS",
     "style": "esriSLSSolid",
     "color": [
      0,
      0,
      0,
      255
     ],
     "width": 1
    },
    "color": [
     14,
     148,
     4,
     255
    ]
   }
  },
  {
   "value": "Mountain",
   "count": 8,
   "label": "Mountain",
   "description": "",
   "symbol": {
    "type": "esriSFS",
    "style": "esriSFSSolid",
    "outline": {
     "type": "esriSLS",
     "style": "esriSLSSolid",
     "color": [
      0,
      0,
      0,
      255
     ],
     "width": 1
    },
    "color": [
     7,
     166,
     97,
     255
    ]
   }
  },
  {
   "value": "New England",
   "count": 6,
   "label": "New England",
   "description": "",
   "symbol": {
    "type": "esriSFS",
    "style": "esriSFSSolid",
    "outline": {
     "type": "esriSLS",
     "style": "esriSLSSolid",
     "color": [
      0,
      0,
      0,
      255
     ],
     "width": 1
    },
    "color": [
     9,
     149,
     184,
     255
    ]
   }
  },
  {
   "value": "Pacific",
   "count": 5,
   "label": "Pacific",
   "description": "",
   "symbol": {
    "type": "esriSFS",
    "style": "esriSFSSolid",
    "outline": {
     "type": "esriSLS",
     "style": "esriSLSSolid",
     "color": [
      0,
      0,
      0,
      255
     ],
     "width": 1
    },
    "color": [
     14,
     45,
     201,
     255
    ]
   }
  },
  {
   "value": "South Atlantic",
   "count": 9,
   "label": "South Atlantic",
   "description": "",
   "symbol": {
    "type": "esriSFS",
    "style": "esriSFSSolid",
    "outline": {
     "type": "esriSLS",
     "style": "esriSLSSolid",
     "color": [
      0,
      0,
      0,
      255
     ],
     "width": 1
    },
    "color": [
     112,
     18,
     219,
     255
    ]
   }
  },
  {
   "value": "West North Central",
   "count": 7,
   "label": "West North Central",
   "description": "",
   "symbol": {
    "type": "esriSFS",
    "style": "esriSFSSolid",
    "outline": {
     "type": "esriSLS",
     "style": "esriSLSSolid",
     "color": [
      0,
      0,
      0,
      255
     ],
     "width": 1
    },
    "color": [
     237,
     21,
     216,
     255
    ]
   }
  },
  {
   "value": "West South Central",
   "count": 4,
   "label": "West South Central",
   "description": "",
   "symbol": {
    "type": "esriSFS",
    "style": "esriSFSSolid",
    "outline": {
     "type": "esriSLS",
     "style": "esriSLSSolid",
     "color": [
      0,
      0,
      0,
      255
     ],
     "width": 1
    },
    "color": [
     255,
     25,
     87,
     255
    ]
   }
  }
 ]
}JSON Response Syntax (when classificationDeftype is classBreaksDef)
{
  "type" : "classBreaks",
  "field" : "<field>",
  "classificationMethod" : "<classification method>",
  "normalizationType" : "<esriNormalizeByField | esriNormalizeByLog | esriNormalizeByPercentOfTotal>",
  "normalizationField" : "<normalization field>", //when normalizationType is esriNormalizeByField
  "normalizationTotal" : <total value>, //when normalizationType is esriNormalizeByPercentOfTotal
  "minValue" : <minValue>,
  "classBreakInfos" : [
    {
      "classMinValue" : <classMinValue1>, //optional
      "classMaxValue" : <classMaxValue1>,
      "label" : "<label1>",
      "description" : "<description1>",
      "symbol" :  <symbol1>
    },
    {
      "classMinValue" : <classMinValue2>,
      "classMaxValue" : <classMaxValue2>,
      "label" : "<label2>",
      "description" : "<description2>",
      "symbol" :  <symbol2>
    }
  ]
}JSON Response Example (when classificationDeftype is classBreaksDef)
{
 "type": "classBreaks",
 "field": "pop2007",
 "minValue": 523174,
 "classBreakInfos": [
  {
   "classMaxValue": 1352536,
   "label": "523174 - 1352536",
   "description": "",
   "symbol": {
    "type": "esriSMS",
    "style": "esriSMSSquare",
    "size": 10.5,
    "angle": 23,
    "xoffset": -10,
    "yoffset": 0,
    "color": [
     0,
     255,
     0,
     255
    ]
   }
  },
  {
   "classMaxValue": 2969306,
   "label": "1352537 - 2969306",
   "description": "",
   "symbol": {
    "type": "esriSMS",
    "style": "esriSMSSquare",
    "size": 10.5,
    "angle": 23,
    "xoffset": -10,
    "yoffset": 0,
    "color": [
     0,
     255,
     128,
     255
    ]
   }
  },
  {
   "classMaxValue": 5360578,
   "label": "2969307 - 5360578",
   "description": "",
   "symbol": {
    "type": "esriSMS",
    "style": "esriSMSSquare",
    "size": 10.5,
    "angle": 23,
    "xoffset": -10,
    "yoffset": 0,
    "color": [
     0,
     255,
     255,
     255
    ]
   }
  },
  {
   "classMaxValue": 8891611,
   "label": "5360579 - 8891611",
   "description": "",
   "symbol": {
    "type": "esriSMS",
    "style": "esriSMSSquare",
    "size": 10.5,
    "angle": 23,
    "xoffset": -10,
    "yoffset": 0,
    "color": [
     0,
     128,
     255,
     255
    ]
   }
  },
  {
   "classMaxValue": 37483448,
   "label": "8891612 - 37483448",
   "description": "",
   "symbol": {
    "type": "esriSMS",
    "style": "esriSMSSquare",
    "size": 10.5,
    "angle": 23,
    "xoffset": -10,
    "yoffset": 0,
    "color": [
     0,
     0,
     255,
     255
    ]
   }
  }
 ]
}