Generate Product

Description

LicenseLicense:

The use of this resource requires an ArcGIS GIS Server Advanced license and a Production Mapping or Defense Mapping server extension license.

The generateProduct operation automates the process of producing a layout or map based on an existing map product definition.

Request parameters

Parameter

Details

productName

(Required)

The name of the product.

This value must match a name from https://<topographicProductionServer-url>/products.

productVersion

(Required)

The version of the product to generate.

This value must match a name from the productVersion property in https://<topographicProductionServer-url>/products.

aoiLayer

(Required)

The URL of the layer defining the product's area of interest.

aoiFeatureId

(Required)

The object ID of the area of interest feature in the aoiLayer.

NoteNote:

If you use the optional customAoi parameter to specify a custom AOI, then this parameter is replaced and you cannot use it.

customAoi

(Optional)

An array of features defining the product's area of interest (AOI). One feature is allowed at the current release.

NoteNote:

If you use this optional parameter, it replaces the required aoiFeatureId parameter.

layerExclusion

(Optional)

The json array of layer names to exclude from the product.

Syntax:

[
  "<URL of the layer>",
  "<URL of the layer>",
  "<URL of the layer>"
]

ancillaryLayers

(Optional)

The json array of layer URLs to include in the final product.

Syntax:

[
  {
  "layer": "<URL of the layer>",
  "map": "<name of the map the layer will be inserted into>",
  "layerIndex": "<insertion index of the layer>"
  },
  ...
]

Ancillary layers are added as feature service layers of the final product and don't extract data to the local geodatabase.

NoteNote:

This parameter supports services located in the same portal site as the server object extension (SOE) or services that are publicly available. The featureClass, map, and layerIndex properties in the array are optional. If the dataset is identifiable from the feature service, it is not necessary to provide the featureClass property. The default values are 0 for layerIndex and BaseMap for map.

outputType

(Required)

The string identifying the type of output. Acceptable values are aprx, pagx, pdf, and tiff.

NoteNote:

The APRX and PAGX output types are exported as ZIP files that include a file geodatabase.

outputSettings

(Optional)

The predefined settings for a PDF or TIFF output type. Allowed inputs can either be the name of a preset file included with the ArcGIS Production Mapping or ArcGIS Defense Mapping Enterprise product files, or a JSON data structure that identifies the output settings in one of the formats detailed below.

This parameter was added at 11.0.

outputSettings JSON properties

The following tables contain more information about the outputSettings parameter. Each table corresponds to different outputs:

PDF properties JSON data structure

Property

Details

formatClass

Specifies that the exported file type is PDF.

Value: PDFFormat

DoCompressVectorGraphics

Specifies whether vector content streams are compressed. This option should be left on unless you need clear text for troubleshooting.

Values: true | false

ImageCompression

The compression scheme used to compress image or raster data in the exported file:

  • 0—Compression is not applied.
  • 1—Run-length encoded compression, a lossless compression method that works well if there are large areas of the same color.
  • 2—Lossless compression method that works well for most cases.
  • 3—Lossless compression method using a code table.
  • 4—Lossy compression method that works well for photographic type images.
  • 5—Automatically chooses the best compression type for each image on the page.

4 is used for large images with many unique colors. 2 is used for all other images.

DoEmbedFonts

Specifies whether embeddable fonts should be included in the exported file to maintain font consistency across different platforms. Fonts that do not support embedding are not included, regardless of the value set for this property.

Values: true | false

LayersAndAttributes

Specifies whether layers should be included in the exported file that can be viewed and managed in supported PDF readers. You can also specify whether attribute data from the features should be included. The range of acceptable values is 0 through 2.

  • 0—None are included
  • 1—Only .pdf layers are included
  • 2—Both .pdf layers and feature attributes are included
NoteNote:

Including attributes for a large number of layers can affect performance and increase the size of your output file.

HasGeoRefInfo

Specifies whether geospatial information from the map frames is included in the exported file. When this is included, you can extract x,y coordinate information from the map frames and perform geographic measurement directly on the map frame in supported PDF readers.

Values: true | false

ImageQuality

Specifies the amount of image resampling for raster imagery. This is a ratio that uses the value specified in the Resolution property to decide the effective resolution of raster content in the output file.

The value for this property specifies the ratio used to resample raster data. A value of 1 is a 1:1 ratio, where raster data is resampled at the same dpi as the exported vector data. A value of 3 is a 1:3 ratio, where raster data is stored at a third of the dpi of the vector dpi specified in the Resolution property, which results in a smaller file size. The range of acceptable values is 1 through 5. In many cases, the output file size can be reduced without visibly affecting image quality by specifying a higher value in this parameter.

ImageCompressionQuality

Specifies the amount of image compression applied to the export. Low quality has a smaller file size and results in lower image quality, while the maximum quality has a larger file size but results in higher image quality. This property is only applied when a value of 4 or 5 is specified for the ImageCompression property. The range of acceptable values is 1 through 100.

Password

Specify a password that must be provided before the exported file can be viewed.

DoFullRasterization

Specifies whether all content should be exported as an image. For maps or layouts containing vector layers with a high density of vertices, this can drastically reduce the size of the exported file. Vector-specific properties are not supported if this value is true.

Values: true | false

MasterPassword

Specifies a password that must be provided before edits can be made to the exported file or before changes can be made to the permissions on the exported file.

DoSimulateOverprint

Specifies whether the exported file shows how overlapping areas of ink will appear when printed on a page. When this property is set to false, the colors on top knock out the colors below and only the topmost color prints, without any ink below it. If this property is set to true, the output file shows a simulation of overprinting, indicating how ink above and below would mix on the page when printed.

Values: true | false

CautionCaution:

When you simulate overprinting, vector features are converted to raster images and are not maintained as individual vector layers in the output .pdf document. This results in options specific to vector data, such as LayersAndAttributes, being unavailable.

Learn more about overprinting

DoConvertCharacterMarkerSymbolsToPolygon

When you cannot embed the fonts due to licensing or file format restrictions, set this value to true to export the marker symbols as polygons, which allows them to be viewed on machines that do not have the fonts installed.

Values: true | false

NoteNote:

This does not apply to text; it only applies to font-based marker symbols.

LanguageCode

Specifies the language of the text in the exported layout so a screen reader can interpret it correctly. If multiple languages apply, additional post-processing may be required to set the language appropriately for individual text elements.

The value should be in IETF BCP 47 format.

Title

Specifies the title of the exported file. This is displayed when the document is opened.

Subject

Specifies a brief overview of what the exported file is about.

Author

Specifies the author of the exported file. Some accessibility guidelines suggest that this should be the office or group producing the document and not an individual person.

Keywords

Specifies keywords that help with document searches.

IncludeAccessibilityTags

Specifies whether the output is a tagged .pdf document, which can be read by screen readers or other assistive technologies.

Values: true | false

NoteNote:

Alt text for layout elements is not included in the .pdf document unless this option is checked.

Resolution

Specifies the dpi of the vector data in the exported layout.

If the DoFullRasterization property value is true, then vectors are converted to rasters and stored at the resolution provided in this property.

If the DoFullRasterization property value is false, then this value decides the resolution for vectors, which subsequently impacts the ratio used in the ImageQuality property to resample raster data.

DoClipToGraphicExtent

Specifies whether the extent of the exported layout is cropped to include only areas with layout elements to help eliminate empty space.

Values: true | false

The properties are available when PDF is specified as the output type.

The following JSON data structure is an example of the properties and values associated with the outputSettings parameter for a PDF output.

{
  "formatClass": "PDFFormat",
  "properties": 
    {
    "DoCompressVectorGraphics": true,
    "ImageCompression": 5,
    "DoEmbedFonts": false,
    "LayersAndAttributes": 1,
    "HasGeoRefInfo": true,
    "ImageQuality": 5,
    "ImageCompressionQuality": 100,
    "Password": "test",
    "DoFullRasterization": true,
    "MasterPassword": "testediting",
    "DoSimulateOverprint": false,
    "DoConvertCharacterMarkerSymbolsToPolygon": false,
    "LanguageCode": "en-US",
    "Title": "MyTitle",
    "Subject": "MySubject",
    "Author": "JohnDoe",
    "Keywords": "Test GPL",
    "IncludeAccessibilityTags": true,
    "Resolution": 200,
    "DoClipToGraphicExtent": true
    } 
}
TIFF properties JSON data structure

Property

Details

formatClass

Specifies that the exported file type is a TIFF.

Value: TIFFormat

ColorMode

Specifies how many bits are used to describe color in a pixel.

  • 0—8-bit Adaptive: 255 possible colors. This option uses an adaptive palette to maintain recognizable hues.
  • 1—8-bit Grayscale: 256 shades of gray. All colors are converted to grayscale.
  • 2—24-bit True Color: 16,777,216 possible colors. This option works well for maximum color fidelity.
  • 3—32-bit with Alpha: 16,777,216 possible colors and an alpha (transparency) channel of 255 values. This option is useful for maps or layouts with transparency.

TIFFImageCompression

The compression scheme used to compress image or raster data in the exported file.

  • 0—Compression is not applied.
  • 1—Lossless compression method that works well if there are large areas of the same color.
  • 2—Lossy compression method that works well for photographic type images.
  • 3—Lossless compression method using a code table.
  • 4—Lossless compression method that works well for most cases.

HasGeoTiffTags

Specifies GeoTIFF information that is added directly to the .tiff file header. This allows the exported file to be used as raster data in ArcGIS Pro or other GIS applications.

Values: true | false

NoteNote:

This option is not available for 3D scenes. When exporting a 3D scene, set the GeoReferenceMapFrameName property to the 2D map frame on which you want the GeoTIFF information to be based. With GIS-capable software, you can choose to honor the GeoTIFF information in the export.

ImageCompressionQuality

Specifies the amount of image compression applied to the exported layout. Low quality has a smaller file size and results in lower image quality, while the maximum quality has a larger file size and results in higher image quality. This only applies when a compression value of 2 or 4 is used. The range of acceptable values is 1 through 100.

HasTransparentBackground

Specifies whether the exported layout is on a transparent page instead of a white page.

Values: true | false

GeoReferenceMapFrameName

Specifies the map frame on which the GeoTIFF information is based.

Resolution

Specifies the dpi of the exported layout file.

DoClipToGraphicExtent

Specifies whether the extent of the layout is cropped to include only areas with layout elements to help eliminate blank space.

Values: true | false

The properties are available when a TIFF format is specified as the output type.

The following JSON data structure is an example of the properties and values associated with the outputSettings parameter for a TIFF output.

{
  "formatClass": "TIFFormat",
  "properties":
    {
    "ColorMode": 3,
    "TIFFImageCompression": 3,
    "HasGeoTiffTags": true,
    "ImageCompressionQuality": 100,
    "HasTransparentBackground": false,
    "GeoReferenceMapFrameName": "Map Frame",
    "Resolution": 400,
    "DoClipToGraphicExtent": false
    }
}

Response properties

The following details are for the properties of a response:

Property

Details

jobId

The job identifier.

statusUrl

The URL to query the status of the running job.

Example usage

The following example URL queries the generateProduct REST operation:

https://machine.domain.com/server/rest/services/SampleService/TopographicProductionServer/generateProduct?productName=MTM50&productVersion=TRD45&areaOfInterestLayer=https%3A%2F%2Fmachine.domain.com%2Fserver%2Frest%2Fservices%2FAOIService%2FMapServer%2F0&areaOfInterestFeatureId=120733&layerExclusion=&outputType=pdf&f=json

JSON Response syntax

The following is the syntax of a response:

{
"jobId": <jobID>,
"statusURL": <statusURL>,
"success": <true | false>
}

JSON Response example

The following is an example of a successful response:

{
 "jobId": "0AECA2CE-8690-4EEC-935B-CEA8E403765F",
 "statusUrl": "https://machine.domain.com/server/rest/services/SampleMapService/MapServer/exts/TopographicProductionServer/jobs/job/0AECA2CE-8690-4EEC-935B-CEA8E403765F",
 "success": true
}