Dissolve Boundaries

URL:
https://<geoanalytics-url>/DissolveBoundaries
Methods:
GET
Version Introduced:
10.7

Description

Dissolve Boundaries workflow diagram

The DissolveBoundaries operation finds polygons that intersect or have the same field values and merges them to form a single polygon. You can choose how polygons are merged by specifying one or more fields. For example, if you have a layer of study areas and each study area has a Soil_Type field, you can dissolve boundaries using the Soil_Type field. Adjacent study areas will be merged if they have the same value for Soil_Type . The end result is a layer of study areas classified by soil type.

Request parameters

ParameterDetails

inputLayer (Required)

The layer containing polygon features that will be dissolved.

  • A URL to a feature service layer with an optional filter to select specific features

  • A URL to a big data catalog service layer with an optional filter to select specific features

  • A feature collection

REST examples

Use dark colors for code blocksCopy
1
2
3
4
5
//REST web example
{"url": "https://myportal.domain.com/server/rest/services/Hosted/hurricaneTrack/FeatureServer/0", "filter": "Month = 'September'"}

//REST scripting example
"inputLayer": {"url": "https://myportal.domain.com/server/rest/services/Hosted/hurricaneTrack/FeatureServer/0", "filter": "Month = 'September'"}

dissolveFields (Optional)

One or more fields in the inputLayer that determine how polygons are merged based on field value. If you don't specify fields, polygons that intersect will be dissolved into one polygon by default. If you do specify fields, polygons that share the same value for each of the specified fields will be dissolved into one polygon.

REST examples

Use dark colors for code blocksCopy
1
2
3
4
5
//REST web example
State_Name, District

//REST scripting example
"dissolveFields": "State_Name, District"

summaryFields (Optional)

A list of field names and statistical summary types you want to calculate. Note that the count is always returned. By default, all statistics are returned.

onStatisticField specifies the name of the fields in the target layer. statisticType can be specified as one of the following:

  • Count—For numeric fields, this totals the number of values of all the points in each polygon. For string fields, this totals the number of strings for all the points in each polygon.
  • Sum—Adds the total value of all the points in each polygon. For numeric fields.
  • Mean—Calculates the average of all the points in each polygon. For numeric fields.
  • Min—Finds the smallest value of all the points in each polygon. For numeric fields.
  • Max—Finds the largest value of all the points in each polygon. For numeric fields.
  • Range—Finds the difference between the Min and Max values. For numeric fields.
  • Stddev—Finds the standard deviation of all the points in each polygon. For numeric fields.
  • Var—Finds the variance of all the points in each polygon. For numeric fields.
  • Any—Returns a sample string of a point in each polygon. For string fields.

REST examples

Use dark colors for code blocksCopy
1
2
3
4
5
//REST web example
[{"statisticType": "Mean", "onStatisticField": "Annual_Sales"},{"statisticType": "Sum", "onStatisticField": "Annual_Sales"}]

//REST scripting example
"summaryFields": [{"statisticType": "Mean", "onStatisticField": "Annual_Sales"},{"statisticType": "Sum", "onStatisticField": "Annual_Sales"}]

multipart (Optional)

A Boolean specifies whether multipart features are allowed in the output feature class. If true is specified, multipart features are allowed. If false is specified, multipart features are not allowed. Instead of creating multiple features, individual features will be created for each part. The default value is false.

Values: true | false

REST examples

Use dark colors for code blocksCopy
1
2
3
4
5
//REST web example
true

//REST scripting example
"multipart": false

outputName (Required)

The task will create a feature service of the results. You define the name of the service.

REST examples

Use dark colors for code blocksCopy
1
2
3
4
5
//REST web example
myOutput

//REST scripting example
"outputName": "myOutput"

context (Optional)

The context parameter contains additional settings that affect task execution. For this task, there are five settings:

  • Extent (extent )—A bounding box that defines the analysis area. Only those features that intersect the bounding box will be analyzed.
  • Processing spatial reference (processSR )—The features will be projected into this coordinate system for analysis.
  • Output spatial reference (outSR )—The features will be projected into this coordinate system after the analysis to be saved. The output spatial reference for the spatiotemporal big data store is always WGS84.
  • Data store (dataStore )—Results will be saved to the specified data store. The default is the spatiotemporal big data store.
  • Default aggregation styles (defaultAggregationStyles )—If set to true , results will have square, hexagon, and triangle aggregation styles enabled on results map services.

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
{
  "extent": {extent},
  "processSR": {spatial reference},
  "outSR": {spatial reference},
  "dataStore": {data store},
  "defaultAggregationStyles": {true|false}
}

f

The response format. The default response format is html .

Values: html | json | pjson

Example usage

Below is a sample request URL for DissolveBoundaries:

Use dark colors for code blocksCopy
1
https://webadaptor.domain.com/server/rest/services/System/GeoAnalyticsTools/GPServer/DissolveBoundaries/submitJob?inputLayer={"url":"https://webadaptor.domain.com/server/rest/services/Hurricane/hurricaneTrack/0"}&dissolveFields=State_Name, District&summaryFields=[{"statisticType": "Mean", "onStatisticField": "Wind_Speed"},{"statisticType": "Sum", "onStatisticField": "Pressure"}]&multipart=false&outputName=myOutput&context={"extent":{"xmin":-122.68,"ymin":45.53,"xmax":-122.45,"ymax":45.6,"spatialReference":{"wkid":4326}}}&f=json

Response

When you submit a request, the service assigns a unique job ID for the transaction.

Syntax:

Use dark colors for code blocksCopy
1
2
3
4
{
  "jobId": "<unique job identifier>",
  "jobStatus": "<job status>"
}

After the initial request is submitted, you can use jobId to periodically check the status of the job and messages as described in Check job status. Once the job has successfully completed, use jobId to retrieve the results. To track the status, you can make a request of the following form:

Use dark colors for code blocksCopy
1
https://<analysis url>/DissolveBoundaries/jobs/<jobId>

Access results

When the status of the job request is esriJobSucceeded , you can access the results of the analysis by making a request of the following form:

Use dark colors for code blocksCopy
1
https://<analysis-url>/DissolveBoundaries/jobs/<jobId>/results/output?token=<your token>&f=json
ResponseDescription

output

output returns the dissolved features as polygons. If a summaryFields parameter is specified in the task request, the layer will compute the Count statistics, as well as anything in the summaryFields . These statistics are only calculated on the dissolved fields.

Use dark colors for code blocksCopy
1
{"url": "https://<analysis-url>/DissolveBoundaries/jobs/<jobId>/results/output"}

The result has properties for parameter name, data type, and value. The contents of value depend on the outputName parameter provided in the initial request. The value contains the URL of the feature service layer.

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "paramName": "output",
  "dataType": "GPRecordSet",
  "value":{"url": "<hosted featureservice layer url>"}
}

See Feature output for more information about how the result layer is accessed.

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