- URL:
- https://<dynamic-layer-url>/generateRenderer
- Methods:
- GET
- Required Capability:
- Map
- Version Introduced:
- 10.1
Description
generate  operation is performed on a  dynamic 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 performed 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: Dynamic layer/table source definition. Syntax: Example:  | 
| 
 | Description: The definition using the renderer that is generated. Syntax: Example:  | 
| 
 | Description: A  Example:  | 
Example Usage
Example 1: Generate Renderer using a unique value classification definition, when base  is missing, then server would assign an appropriate base :
Example 2: Generate Renderer using a class breaks classification definition:
JSON Response Syntax (when classification  is unique )
{
  "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 classification  is unique )
{
 "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 classificationDef type 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 classification  is class )
{
 "type": "classBreaks",
 "field": "pop2007",
 "normalizationType": "esriNormalizeByPercentOfTotal",
 "normalizationTotal": 306348230,
 "minValue": 0.17077754945736098,
 "classBreakInfos": [
  {
   "classMaxValue": 0.44150279569103434,
   "label": "0.170778% - 0.441503%",
   "description": "",
   "symbol": {
    "type": "esriSMS",
    "style": "esriSMSSquare",
    "size": 10.5,
    "angle": 23,
    "xoffset": -10,
    "yoffset": 0,
    "color": [
     0,
     255,
     0,
     255
    ]
   }
  },
  {
   "classMaxValue": 0.96925841549663927,
   "label": "0.441504% - 0.969258%",
   "description": "",
   "symbol": {
    "type": "esriSMS",
    "style": "esriSMSSquare",
    "size": 10.5,
    "angle": 23,
    "xoffset": -10,
    "yoffset": 0,
    "color": [
     0,
     255,
     128,
     255
    ]
   }
  },
  {
   "classMaxValue": 1.7498315560693791,
   "label": "0.969259% - 1.749832%",
   "description": "",
   "symbol": {
    "type": "esriSMS",
    "style": "esriSMSSquare",
    "size": 10.5,
    "angle": 23,
    "xoffset": -10,
    "yoffset": 0,
    "color": [
     0,
     255,
     255,
     255
    ]
   }
  },
  {
   "classMaxValue": 2.9024522191624871,
   "label": "1.749833% - 2.902452%",
   "description": "",
   "symbol": {
    "type": "esriSMS",
    "style": "esriSMSSquare",
    "size": 10.5,
    "angle": 23,
    "xoffset": -10,
    "yoffset": 0,
    "color": [
     0,
     128,
     255,
     255
    ]
   }
  },
  {
   "classMaxValue": 12.235568653358957,
   "label": "2.902453% - 12.235569%",
   "description": "",
   "symbol": {
    "type": "esriSMS",
    "style": "esriSMSSquare",
    "size": 10.5,
    "angle": 23,
    "xoffset": -10,
    "yoffset": 0,
    "color": [
     0,
     0,
     255,
     255
    ]
   }
  }
 ]
}