Merge Layers
The Merge Layers task copies features from two layers into a new layer. The layers to be merged must all contain the same feature types (points, lines, or polygons). You can control how the fields from the input layers are joined and copied.
For example:
- I have three layers for England, Wales, and Scotland and I want a single layer of Great Britain.
- I have two layers containing parcel information for contiguous townships. I want to join them together into a single layer, keeping only the fields that have the same name and type on the two layers.
Request URL
http://<analysis url>/MergeLayers/submitJob
Request Parameters
Parameter | Description |
---|---|
inputLayer (Required) | The point, line, or polygon features to merge with the mergeLayer Syntax: As described in detail in the Feature input topic, this parameter can be one of the following:
Examples:
|
mergeLayer (Required) | The point, line, or polygon features to merge with the inputLayer. The mergeLayer must contain the same feature type (point, line, or polygon) as the inputLayer. Syntax: As described in detail in the Feature input topic, this parameter can be one of the following:
Examples:
|
mergingAttributes | An array of values that describe how fields from the mergeLayer are to be modified. By default, all fields from both inputs will be carried across to the output mergedLayer. If a field exists in one layer but not the other, the output mergedLayer will contain both fields. The output field will contain null values for the input features that did not have the field. For example, if the inputLayer contains a field named TYPE but the mergeLayer does not contain TYPE, the output will contain TYPE, but its values will be null for all the features copied from the mergeLayer. You can control how fields on the mergeLayer are written to the output as follows:
Example:
|
outputName | If provided, the task will create a feature service of the results. You define the name of the service. If an outputName value is not provided, the task will return a feature collection. Syntax: Syntax: |
context | The Context parameter contains the following additional settings that affect task operation:
Syntax:
|
f | The response format. The default response format is html. Values: html | json |
Response
When you submit a request, the service assigns a unique job ID for the transaction.
{
"jobId": "<unique job identifier>",
"jobStatus": "<job status>"
}
After the initial
request is submitted you can use the
jobId to periodically check the status of the job and messages as described in the topic Checking job status.
Once the job has successfully completed, you use
the jobId to retrive the results. To track the status, you can make a request of the following form:http://<analysis url>/MergeLayers/jobs/<jobId>
Accessing results
When the status of the job request is esriJobSucceded, you can access the results of the analysis by making a request of the following form.
http://<analysis url>/MergeLayers/jobs/<jobId>/results/mergedLayer?token=<your token>&f=json
Parameter | Description |
---|---|
mergedLayer | The output layer containing the merged features. The result has properties for parameter name, data type, and value. The contents of value depends upon the outputName parameter provided in the initial request.
See Feature Output for more information about how the result layer or collection is accessed. |