- URL:https://<catalog-url>/Utilities/Symbols/SymbolServer/generateImage
- Version Introduced:11.0
Description
The generateImage operation returns a single symbol based on a web style item. This operation supports extracting a symbol from a 2D web style using the symbolName parameter. Both the symbolName and dictionaryFeatures parameters can be used to extract a symbol from a dictionary web style. Once submitted, this operation returns the requested image. The generateImage operation can be submitted as either a GET or POST request.
Request parameters
Parameter | Details |
---|---|
webstyle (Required) | The web style ArcGIS Enterprise portal item ID. The web style must belong to the same organization the ArcGIS Server is federated to. Example
|
symbolName (Required for 2D web styles) | The symbol name. This is the symbol style item key that is defined in the web style.
|
dictionaryFeatures (Required for dictionary styles) | The attributes and configuration key and value pairs for dictionary-based styles.
|
size (Optional) | The size (width and height) of the exported image in pixels. If the size is not specified, the image will be constrained by the requested symbol's size. Example
|
scaleFactor (Optional) | The symbol service using a double value. A value of 1.0 implies the symbol is not scaled. Setting the value to 1.5 scales the image to 50 percent more than the image's original size. Settings the value to 0.5 reduces the image's original size by 50 percent. If both the size and scaleFactor parameters are specified, both changes will be honored; the symbol will be scaled to the value set for scaleFactor and resized to the value set for the size parameter. Example
|
centerAnchorPoint (Optional) | The symbol placement in the image. When set to true, the original symbol anchor point placement in the image is honored. When set to false, the symbol is centered to the image. Having the image centered can be useful if you want to preview the whole symbol without taking symbol offset or anchor points into account. The default value is false. Note:When centerAnchorPoint is true, the size parameter must be empty. The size parameter takes precedence over centerAnchorPoint. Values: true | false |
imageFormat (Required) | The image format. The default format is png. Values: png | png8 | png24 | png32 | jpg | bmp | gif | svg | svgz |
dpi (Optional) | The device resolution of the exported image (dots per inch). If the dpi value is not specified, an image with a default DPI of 96 will be exported. Example
|
f | The response format. The only supported response format is image. |
Example usage
The following is a sample request for the generateImage operation that demonstrates generating a symbol from a 2D web style:
https://machine.domain.com/webadaptor/rest/services/Utilities/Symbols/SymbolServer/generateImage?webstyle=c6292c3caf444c76b24dd67c9569b66f&symbolName=TinosPizza&dictionaryFeatures=&size=200,200&scaleFactor=2.0¢erAnchorPoint=false&imageFormat=png32&dpi=150&f=image
The following is a sample POST request for the generateImage operation that demonstrates generating a symbol from a dictionary stye:
POST /webadaptor/rest/services/Utilities/Symbols/SymbolServer/generateImage HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
webstyle=c6292c3caf444c76b24dd67c9569b66f&symbolName=&dictionaryFeatures={"attributes": {"name": "Tino's Pizza","style": "pizza","price": 2}}&&size=200,200&scaleFactor=2.0¢erAnchorPoint=false&imageFormat=png32&dpi=150&f=image