- URL:
- https://<root>/<serviceName>/TopographicProductionServer/addProduct
- Methods:
POST
- Related Resources:
- Generate Product, Remove Product, Update Product
- Required Capability:
- Requires an ArcGIS GIS Server Advanced license and a Production Mapping or Defense Mapping server extension license
- Version Introduced:
- 10.9
Description
The add
operation adds a definition of a map product to the Topographic Production Service resource that can be used to generate a map.
Request parameters
Parameter | Details |
---|---|
(Required) | The JSON definition of a map product. |
(Optional) |
The path to a raster on disk (server path) or the URL of an image service. |
(Optional) | A JSON array of additional layers to include in the final product. Syntax:
|
productDefinition properties
The following table describes additional properties for the map product specified in the product
parameter:
Property | Details |
---|---|
| Indicates the serialization version, currently at version 0. |
| The name of the product. It must be unique in the map service. |
| Indicates the product type. Accepted values include |
| Indicates the type of grid XML to use when running grid operations. |
| Describes the type of map product being produced. |
| The field name that identifies the area of interest (AOI) for which the product is generated. This must be a field that exists on the features used to define the AOI. |
| An array of versions for this product. A version is a JSON with two properties,
|
| Resources are defined with three key-value pairs:
To use a resource, place brackets around its name. In the following example, the resource
These are predefined resources known to the server object extension (SOE). The values of these resources are left blank in the JSON definition and the SOE sets the value at runtime. For example, the |
| Defines how the data will be extracted. The following is an example syntax of a data extraction operation in an array:
The following is an example of the dataExtraction operation:
|
| An operation is typically a geoprocessing operation, but there are also other types of operations. Operation types are predefined by the app so that it can optimize the order in which the operations are performed. The following is a list of available types:
An operation is defined with the following syntax:
Example MapResource operation:
Refer to the map product definitions in the Defense Mapping product files to learn more about how operations are used. |
| A JSON array of custom operations that are run after files for a map product have been created. |
| Defines the structure for the zipped file that is exported. |
Types of resources
The following table provides more details about the types of resources:
Resource | Type | Syntax | Details |
---|---|---|---|
Value | 1 |
| Returns the value defined in the resource. |
Layer | 2 |
| Returns the layer's name. Returns the Cartographic Information Model (CIM) path to the layer. Returns a string that represents the extent of the layer. |
Workspace | 3 |
| The path to a dataset that this resource returns can be a table, feature class, or feature dataset. |
GridLocator | 4 |
| Returns the path to the correct grid |
Layout | 6 |
| Returns the layout's name. Returns the Cartographic Information Model (CIM) path to the layout. Returns the layer's name. Returns the CIM path to a specific map in the layout. Returns the reference scaled of a specific map in the layout. Returns the extent of a specific map in the layout. Returns the spatial reference of a specific map in the layout. Returns the CIM path to a layer in a specific map in the layout. Returns the extent of a layer in a specific map in the layout. |
ProductFiles | 7 |
| Returns the path to the file name in the product files. |
JobResource | 9 |
| Returns the path to the ArcGIS Pro project that the job created. Returns the job's ID. Returns the job's name. Returns the name of the person who submitted the job. Returns Returns Returns all of the job's messages. |
PackageResource | 10 |
| Returns the .aprx file. Returns the path to database associated with the project file. Returns the path to the exported output file. Returns the template that is to be used with the input. Returns the raster file to use. Returns the path to the archive. Returns the path to the staging directory. Returns the path to the output directory. Returns the name of the packaged file. Returns the path to the final output package that will be available through the public service URL. |
Request example
The following is an example of the product
parameter:
{
"version": 0,
"name": "ExampleProduct",
"type": "MTM",
"gridType": "TM50",
"description": "Test Masking Product",
"sheetIDField": "NRN",
"featureDataset": "BM",
"extractionDatabase": "MTM.gdb",
"scale": "1:50,000",
"productVersions": [
{
"name": "TRD_4_5",
"template": "MTM50_Layout.pagx"
}
],
"resources": [
{
"name": "SourceWorkspace",
"type": 3,
"value": ""
},
{
"name": "AOILayer",
"type": 2,
"value": ""
},
{
"name": "SheetID",
"type": 1,
"value": ""
},
{
"name": "Layout",
"type": 6,
"value": ""
},
{
"name": "ProductFiles",
"type": 7,
"value": ""
}
],
"dataExtraction": [
{
"name": "MapService",
"type": 19,
"id": "MapService",
"description": "Test extract from Map Service",
"parameters": [
{
"name": "input_data",
"value": "https://machinename.esri.com/server/rest/services/PostGreTest/MapServer"
},
{
"name": "AOI",
"value": "[AOILayer]\\Extent"
},
{
"name": "buffer",
"value": "5 kilometers"
},
{
"name": "spatial_relationship",
"value": "esriSpatialRelIntersects"
},
{
"name": "DefinitionQuery",
"value": ""
},
{
"name": "includeDatasets",
"value": ""
},
{
"name": "excludedDatasets",
"value": ""
}
]
}
],
"operations": [
{
"name": "MapResource",
"type": 11,
"id": "62C3FFDE-F2C9-401E-9F57-50BECC3E15AP",
"description": "Update BaseMap DataSources",
"parameters": [
{
"name": "in_map",
"value": "BaseMap"
}
]
},
{
"name": "Grid",
"type": 4,
"id": "22C3FFDE-F4C9-401E-9F57-50BRCC3E15GN",
"description": "BaseMap Grid",
"toolName": "MakeGridsAndGraticulesLayer_topographic",
"validation": 2,
"properties": {
"type": "PropertySet",
"propertySetItems" : [
"AddOutputToMap",
"BaseMap"
]
},
"parameters": [
{
"name": "in_grid_xml",
"value": "[GridLocator]\\BaseMap"
},
{
"name": "area_of_interest",
"value": "[AOILayer]"
},
{
"name": "target_feature_dataset",
"value": "[SourceWorkspace]\\BM_GRD"
},
{
"name": "out_layer_name",
"value": "BMGrid"
},
{
"name": "grid_name",
"value": "BMGrid"
},
{
"name": "configure_layout",
"value": "CONFIGURE_LAYOUT"
},
{
"name": "layout",
"value": "[Layout]"
},
{
"name": "map_frame",
"value": "BaseMap Map Frame"
}
]
},
{
"name": "CreateMasks",
"type": 7,
"id": "35C3FFRF-F2C9-401E-9F57-30BECC3E15KF",
"description": "Create Masks for Base Map",
"toolName": "MakeMasksFromRules_topographic",
"validation": 2,
"properties" : {
"type" : "PropertySet",
"propertySetItems" : [
"MapName",
"BaseMap"
]
},
"parameters": [
{
"name": "in_map",
"value": "BaseMap"
},
{
"name": "rule_file",
"value": "[ProductFiles]\\MTM_Basemap_Masking_Rules.xml"
},
{
"name": "out_feature_dataset",
"value": "[SourceWorkspace]\\Masks"
}
]
},
{
"name": "ApplyMasks",
"type": 7,
"id": "93C3FFDE-F2C9-401K-9F57-50BRCC3E15RW",
"description": "Apply Masks for Base Map",
"toolName": "ApplyMasksFromRules_topographic",
"validation": 2,
"properties" : {
"type" : "PropertySet",
"propertySetItems" : [
"MapName",
"BaseMap"
]
},
"parameters": [
{
"name": "in_map",
"value": "BaseMap"
},
{
"name": "rule_file",
"value": "[ProductFiles]\\MTM_Basemap_Masking_Rules.xml"
},
{
"name": "in_feature_dataset",
"value": "[SourceWorkspace]\\Masks"
}
]
}
]
}
Example usage
The following URL is an example of the add
REST operation:
https://machine.domain.com/server/rest/services/SampleService/TopographicProductionServer/addProduct?productDefinition=&raster=&ancillaryLayers=&f=json
JSON Response syntax
The following is the syntax of a response:
{
"success" : <true | false>
}
JSON Response example
The following is an example response when the product is added successfully:
{
"productName": "ExampleProduct",
"success": true
}
The following is an example error response:
{
"error": {
"code": -2147211754,
"message": "Map product ExampleProduct already exists. Map product names must be unique.",
"details": [
]
}
}