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 Production Mapping or Defense Mapping product files, or a JSON 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 additional details about the outputSettings parameter. Each table corresponds to different outputs:

PDF properties JSON 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. The numerical value is associated to a string in ArcGIS Pro as follows:

  • 0None: Compression is not applied.
  • 1RLE: Run-length encoded compression, a lossless compression method that works well if there are large areas of the same color.
  • 2Deflate: Lossless compression method that works well for most cases.
  • 3LZW: Lossless compression method using a code table.
  • 4JPEG: Lossy compression method that works well for photographic type images.
  • 5Adaptive: Automatically chooses the best compression type for each image on the page. JPEG is used for large images with many unique colors. Deflate 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 numerical value is associated to a string in ArcGIS Pro as follows:

  • 0None
  • 1PDF Layers Only
  • 2PDF Layers and Feature Attributes
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. The figure provided determines effective resolution of raster content on the output file. In many cases, the raster data can be included at a lower dots per inch (dpi) than the vector data without visibly affecting quality, which reduces the output file size.

The value for this property determines the ratio used to set the dpi for raster data. A 1 corresponds to Best in ArcGIS Pro and means a 1:1 ratio, where raster dpi is the same as vector dpi. A 3 corresponds to Normal in ArcGIS Pro and is a 1:3 ratio, where raster dpi is a third of the vector dpi specified in the Resolution property and results in a smaller file size. The range of acceptable values is 1 through 5.

ImageCompressionQuality

Specifies the amount of image compression applied to the export. Low quality has a smaller file size but less clear data, while the maximum quality has a larger file size but crisper data. This only applies when JPEG or Adaptive compression is used. The range of acceptable values is 1 through 100.

Password

Specify a password that must be provided before you or others can view the exported file.

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

Specify a password that must be provided before you or others can edit or be granted permissions on the exported file.

DoSimulateOverprint

Specifies whether the exported file reflects overlapping areas of ink. By default, 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 will show a simulation of overprinting, indicating how ink above and below would mix on the page if printed.

Values: true | false

CautionCaution:

When you simulate overprint on an export, vector features are rasterized into images. They 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

Specifies whether marker symbols based on font characters are included in the exported file as font characters or as polygons. A true value exports them as polygons, which allows them to be seen on a machine that does not have the fonts installed and you cannot embed the fonts due to licensing or file format restrictions.

Values: true | false

NoteNote:

This does not apply to text; it only applies to marker symbols based on fonts.

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.

DoClipToGraphicExtent

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

Values: true | false

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

The following JSON 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 structure

Property

Details

formatClass

Specifies that the exported file type is a TIFF format.

Value: TIFFormat

ColorMode

Specifies how many bits are used to describe color in a pixel. The numerical value you provide is associated to a string in ArcGIS Pro as follows:

  • 08-bit Adaptive: 255 possible colors. This option uses an adaptive palette to maintain recognizable hues.
  • 18-bit Grayscale: 256 shades of gray. All colors are converted to grayscale.
  • 224-bit True Color: 16,777,216 possible colors. This option works well for maximum color fidelity.
  • 332-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. The numerical value is associated to a string in ArcGIS Pro as follows:

  • 0None: Compression is not applied.
  • 1Pack Bits: Lossless compression method that works well if there are large areas of the same color.
  • 2JPEG: Lossy compression method that works well for photographic type images.
  • 3LZW: Lossless compression method using a code table.
  • 4Deflate: 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 views. When exporting, set the GeoReferenceMapFrameName property to the 2D map frame that you want the GeoTIFF information to be based on. 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 but less clear data, while the maximum quality has a larger file size but crisper data. This only applies when a 2 or 4 compression 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 that the GeoTIFF information is based on.

Resolution

The exported layout file's resolution in dpi.

DoClipToGraphicExtent

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

Values: true | false

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

The following JSON 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
}