- URL:
- https://<root>/<serviceName>/FeatureServer/<layerId>/generateRenderer
- Methods:
GET- Required Capability:
- Query
- Version Introduced:
- 10.1
Description
The 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 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 defined in the following parameters table:
Request parameters
| Parameter | Details |
|---|---|
|
The response format. The default response format is Values: |
| Description: The definition with which the renderer is generated. Note: Use either the ClassBreaks or UniqueValue classification definition. Syntax: Example: |
| Description: A where clause for which the data needs to be classified. Any legal SQL where clause operating on the fields in the layer/table is allowed. Example: |
| Description: The geodatabase version from which the data will be rendered. This parameter applies only if the If this is not specified, the renderer will be generated from the published map’s version. Syntax: Example: |
Example usage
Generate Renderer using a unique value classification definition:
https://services.myserver.com/arcgis/rest/services/PoolPermits/FeatureServer/0/generateRenderer?classificationDef={"type":"uniqueValueDef","uniqueValueFields":["Has_Pool"],"fieldDelimiter": ",","baseSymbol":{"type": "esriSFS","style": "esriSLSSolid","width":2},"colorRamp":{"type":"algorithmic","fromColor":[115,76,0,255],"toColor":[255,25,86,255],"algorithm": "esriHSVAlgorithm"}}&where=&f=html
JSON response syntax (when symbol is included in classification definition)
{
"type": "uniqueValue",
"field1": "EVENTID",
"field2": "",
"field3": "",
"fieldDelimiter": ",",
"defaultSymbol": {
"type": "esriSLS",
"style": "esriSLSSolid",
"width": 2
},
"defaultLabel": "",
"uniqueValueInfos": [
{
"value": "",
"label": "",
"description": "",
"symbol": {
"type": "esriSLS",
"style": "esriSLSSolid",
"width": 2,
"color": [
115,77,0,255
]
}
},
{
"value": "Alberto",
"label": "Alberto",
"description": "",
"symbol": {
"type": "esriSLS",
"style": "esriSLSSolid",
"width": 2,
"color": [
120,122,1,255
]
}
},
{
"value": "Beryl",
"label": "Beryl",
"description": "",
"symbol": {
"type": "esriSLS",
"style": "esriSLSSolid",
"width": 2,
"color": [
83,133,3,255
]
}
},
{
"value": "Chris",
"label": "Chris",
"description": "",
"symbol": {
"type": "esriSLS",
"style": "esriSLSSolid",
"width": 2,
"color": [
39,143,4,255
]
}
},
{
"value": "Debby",
"label": "Debby",
"description": "",
"symbol": {
"type": "esriSLS",
"style": "esriSLSSolid",
"width": 2,
"color": [
255,25,86,255
]
}
}
]
}