Dissolve boundaries

A dissolve analysis resulting in a new layer with a city boundary generated from neighborhood polygons.

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 DissolveBoundaries operation.

dissolve boundaries

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:

  1. Review the parameters for the DissolveBoundaries operation.
  2. Send a request to get the spatial analysis service URL.
  3. Execute a job request with the following URL and parameters:
    • URL: https://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/DissolveBoundaries/submitJob
    • Parameters:
      • inputLayer: The hosted feature layer or feature collectioncontaining polygon features that will be dissolved.
      • dissolveFields: One or more fields from the inputLayer that control which polygons are merged. If you don't supply dissolveFields, 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.
      • outputName: A string representing the name of the hosted feature layer to return with the results.
  4. Check the status.
  5. 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

Use dark colors for code blocksCopy
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/DissolveBoundaries/submitJob?<parameters>

Required parameters

Name
Description
Examples
fThe format of the data returnedf=json f=pjson
token

An access token (API key or OAuth 2.0) with the required Spatial Analysis > Feature analysis privilege.

token=<ACCESS_TOKEN>
inputLayerThe layer containing polygon features that will be dissolved.{"url": <SERVICE_URL>, "filter": <where clause>}

{"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}

Key parameters

NameDescriptionExamples
dissolveFieldsOne or more fields from the inputLayer that control which polygons are merged."dissolveFields": ["Class"]
summaryFieldsA list of field names and statistical summary type that you wish to calculate from the polygons that are dissolved together"summaryFields": ["Annual_Sales Sum", "Annual_Sales Min"]
outputNameA 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).{"serviceProperties": {"name": "<SERVICE_NAME>"}}

Example

Dissolve boundaries by attribute value

This example uses the DissolveBoundaries operation to dissolve a hosted feature layer of township polygons based on their attribute values.

In the analysis, the inputLayer value is the Municipal Boundaries hosted feature layer. The dissolveFields value is specified as the field Class and multiPartFeatures is set to true. The results contain new Count and AnalysisArea fields containing the statistical details of the dissolve operation.

Dissolve analysis showing township polygons dissolved by an attribute value.

APIs

ArcGIS API for PythonArcGIS API for PythonArcGIS REST JS
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
HTTPHTTPcURL
Use dark colors for code blocksCopy
1
2
3
4
5
POST arcgis.com/sharing/rest/portals/self HTTP/1.1
Content-Type: application/x-www-form-urlencoded

&f=json
&token=<ACCESS_TOKEN>
Response (JSON)
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
{
  "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"
    }
  }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.