Generate Image

URL:
https://<root>/Utilities/Symbols/SymbolServer/generateImage
Methods:
GET
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

ParameterDetails

webstyle

(Required)

The item ID for the ArcGIS Enterprise web style. The web style must belong to the same organization the ArcGIS Server is federated to.

Example:

Use dark colors for code blocksCopy
1
webstyle=c6292c3caf444c76b24dd67c9569b66f

symbolName

(Required for 2D web styles)

The symbol name. This is the symbol style item key that is defined in the web style.

Use dark colors for code blocksCopy
1
symbolName=TinosPizza

dictionaryFeatures

(Required for dictionary styles)

The attributes and configuration key and value pairs for dictionary-based styles.

Use dark colors for code blocksCopy
1
dictionaryFeatures={"attributes": {"name": "Tino's Pizza","style": "pizza","price": 2}}

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:

Use dark colors for code blocksCopy
1
size=200,200

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

Use dark colors for code blocksCopy
1
scaleFactor=2.0

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.

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

Use dark colors for code blocksCopy
1
dpi=150

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:

Use dark colors for code blocksCopy
1
https://<machineName>.<domain>.com/webadaptor/rest/services/Utilities/Symbols/SymbolServer/generateImage?webstyle=c6292c3caf444c76b24dd67c9569b66f&symbolName=TinosPizza&dictionaryFeatures=&size=200,200&scaleFactor=2.0&centerAnchorPoint=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:

Use dark colors for code blocksCopy
1
2
3
4
5
6
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&centerAnchorPoint=false&imageFormat=png32&dpi=150&f=image

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