What is a dissolve analysis?
A dissolve analysis is the process of combining polygons from feature datasets that overlap or share a common boundary. To execute the analysis, use the spatial analysis service and the Dissolve
operation.
Dissolve can also generate geature geometry and attribute summary statistics.
Real-world examples of this analysis include the following:
- Creating a state or city boundary.
- Creating contiguous sales regions based on the salesperson's name in each county.
- Visualizing what points of interest or other features are within dissolved drive-time polygons.
How to perform a dissolve analysis
The general steps to performing a dissolve analysis are as follows:
- Review the parameters for the
Dissolve
operation.Boundaries - Send a request to get the spatial analysis service URL.
- Execute a job request with the following URL and parameters:
- URL:
https:
//< YOUR_ ANALYSIS_ SERVICE>/arcgis/rest/services/tasks/GPServer/Dissolve Boundaries/submit Job - Parameters:
input
: The hosted feature layer or feature collectioncontaining polygon features that will be dissolved.Layer dissolve
: One or more fields from theFields input
that control which polygons are merged. If you don't supplyLayer dissolve
, or you supply an empty list of fields, polygons that share a common border (that is, they are adjacent) or polygon areas that overlap will be dissolved into one polygon. The result will always include a Count field, which represents the number of input features that share the dissolve criteria.Fields output
: A string representing the name of the hosted feature layer to reutrn with the results.Name
- URL:
- Check the status.
- Get the output layer results.
To see examples using ArcGIS API for Python, ArcGIS REST JS, and the ArcGIS REST API, go to Examples below.
URL request
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/DissolveBoundaries/submitJob?<parameters>
Required parameters
Name | Description | Examples |
---|---|---|
f | The format of the data returned | f=json f=pjson |
token | An OAuth 2.0 access token. Learn how to get an access token in Security and authentication. | token=< |
input | The layer containing polygon features that will be dissolved. | {"url": < {"layer |
Key parameters
Name | Description | Examples |
---|---|---|
dissolve | One or more fields from the input that control which polygons are merged. | "dissolve |
summary | A list of field names and statistical summary type that you wish to calculate from the polygons that are dissolved together | "summary |
output | A string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON). | {"service |
Example
Dissolve boundaries by attribute value
This example uses the Dissolve
operation to dissolve a hosted feature layer of township polygons based on their attribute values.
In the analysis, the input
value is the Munical Boundaries hosted feature layer. The dissolve
value is specified as the field Class
and multi
is set to true
. The results contain new Count
and Analysis
fields containing the statistical details of the dissolve operation.
APIs
inputLayer = "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Delaware_County_Municipal_Boundaries/FeatureServer/0"
dissolveField = "Class"
results = dissolve_boundaries(
input_layer=inputLayer,
multi_part_features=True,
dissolve_fields=[dissolveField],
# Outputs results as a hosted feature layer.
output_name="Dissolve boundaries results",
)
result_features = results.layers[0].query()
print(f"Merged layer contains {len(result_features.features)} new records")
Service requests
Request
POST arcgis.com/sharing/rest/portals/self HTTP/1.1
Content-Type: application/x-www-form-urlencoded
&f=json
&token=<ACCESS_TOKEN>
Response (JSON)
{
"helperServices": {
// Other parameters
"analysis": {
"url": "https://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer"
},
"geoenrichment": {
"url": "https://geoenrich.arcgis.com/arcgis/rest/services/World/GeoenrichmentServer"
}
}
}
Request
POST <YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/DissolveBoundaries/submitJob HTTP/1.1
Content-Type: application/x-www-form-urlencoded
f=json
&token=<ACCESS_TOKEN>
&inputLayer={"url":"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Delaware_County_Municipal_Boundaries/FeatureServer/0"}
&multiPartFeatures=true
&dissolveFields=["Class"]
&outputName={"serviceProperties":{"name":"Dissovle boundaries results"}}
Response (JSON)
{
"jobId": "<JOB_ID>",
"jobStatus": "esriJobSubmitted",
"results": {},
"inputs": {},
"messages": []
}
Request
POST <YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/DissolveBoundaries/jobs/<JOB_ID> HTTP/1.1
Content-Type: application/x-www-form-urlencoded
f=json
&token=<ACCESS_TOKEN>
Response (JSON)
{
"jobId": "<JOB_ID>",
"jobStatus": "esriJobSucceeded",
"results": {
"dissolvedLayer": {
"paramUrl": "results/dissolvedLayer"
}
},
"inputs": {},
"messages": []
}
Request
POST <YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/DissolveBoundaries/jobs/<JOB_ID>/results/dissolvedLayer HTTP/1.1
Content-Type: application/x-www-form-urlencoded
f=json
&token=<ACCESS_TOKEN>
Response (JSON)
"width": 1.5
}
}
},
"transparency": 25
}
}
}
}
Tutorials
Learn how to perform related analyses interactively with Map Viewer and programmatically with ArcGIS API for Python, ArcGIS REST JS, and ArcGIS REST API.
Services
Spatial analysis service
Process spatial datasets to discover relationships and patterns.
API support
- 1. Access with geoprocessing task
- 2. Access via ArcGIS REST JS
Tools
Developer dashboard
Manage API keys, service usage, and data with the ArcGIS Developers website.
ArcGIS.com
Create, manage, and share content and data with GIS tools.
Map Viewer
Create, explore, and share web maps for 2D applications.
ArcGIS Pro
Explore, visualize, and analyze both 2D and 3D data with desktop GIS tools.