What is a dissolve analysis?
A dissolve analysis is the process of combining polygons from feature datasetsDissolve operation.
Dissolve can also generate feature 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
Dissolveoperation.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/ GP Server/ Dissolve Boundaries/submit Job - Parameters:
input: The hosted feature layerLayer A hosted feature layer is a hosted layer (item) in a portal that is used to manage the properties and settings of a spatially-enabled feature layer in a feature service. or feature collectionA feature collection is a data structure containing one or more features that share the same geometry type and set of attributes. containing polygon features that will be dissolved.dissolve: One or more fields from theFields inputthat 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 return 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 access token | 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 | {"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 Municipal 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"
}
}
}
{
"helperServices":{
// Other parameters
"analysis": {
"url": "https://{YOUR_ANALYSIS_SERVICE}/{WEBADAPTOR_NAME}/rest/services/System/SpatialAnalysisTools/GPServer"},
}
}