FRAMES | NO FRAMES Description | Parameters | Examples | Response
Union (Operation)
URL http://<geometryservice-url>/union
Parent Resource Geometry Service

Description

The union operation is performed on a geometry service resource.This operation constructs the set-theoretic union of the geometries in the input array. All inputs must be of the same type.

From 10.1 onwards this operation will call Simplify on the input geometries.

You can provide arguments to the union operation as query parameters defined in the parameters table below.

Parameters

Parameter Details
f Description: The response format. The default response format is html.

Values: html | json
geometries Description: The array of geometries to be unioned. The structure of each geometry in the array is same as the structure of the json geometry objects returned by the ArcGIS REST API.

Syntax and Examples:

JSON Structures:

Syntax:
{
"geometryType" : "<esriGeometryPoint | esriGeometryMultipiont | esriGeometryPolyline | esriGeometryPolygon>"
"geometries" : [ <geometry1>, <geometry2> ]
}

The "geometries" property is an array of input geometries. All geometries in this array should be of the type defined by "geometryType".

Example:
{
  "geometryType":"esriGeometryPolygon",
  "geometries":[
 {
  "rings" : [
   [[-117,34],[-116,34],[-117,33],[-117,34]],
   [[-115,44],[-114,43],[-115,43],[-115,44]]
  ]
 },
 {
  "rings" : [
   [[32.49,17.83],[31.96,17.59],[30.87,17.01],[30.11,16.86],[32.49,17.83]]
  ]
 }
]
}
sr Description: The well-known ID of the spatial reference or a spatial reference json object for the input geometries. For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems.

Example Usage

Example 1: Union two multipoint geometries

http://sampleserver3.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer/union?sr=102113
&geometries={"geometryType": "esriGeometryMultipoint","spatialReference": {"wkid": 102113}, "geometries":[{"points":[[-8418433.3989,5262954.0867],[-8353363.717800001,5381714.5528],[-8250336.7228,5337002.1307],[-8250336.7228,5509587.154700004]]},{"points":[[-1.37211748048E7,4991906.4582],[ -1.35126474057E7,4800770.159900002],[-1.35126474057E7,4991906.4582],[-1.3470941925900001E7,4468209.699000001],[-1.32936936367E7,4494424.728500001],[-1.31998563072E7,4133116.2506000027],[-1.3126871717500001E7,4260779.642999999],[ -1.29391970583E7,4044613.1774000004],[-1.29183443184E7,4222325.328299999],[ -1.28870652086E7,3906909.467299998]]}]}&f=html

JSON Response Syntax

{
"geometryType" : "<esriGeometryPoint | esriGeometryMultipiont | esriGeometryPolyline | esriGeometryPolygon>"
"geometry" :
<geometry>
}

JSON Response Example

{
  "geometryType" : "esriGeometryMultipoint", 
  "geometry" : 
  {
    "points" : 
    [
      [-13721174.8048, 4991906.4582], 
      [-13512647.4057, 4800770.1599], 
      [-13512647.4057, 4991906.4582], 
      [-13470941.9259, 4468209.699], 
      [-13293693.6367, 4494424.7285], 
      [-13199856.3072, 4133116.2506], 
      [-13126871.7175, 4260779.643], 
      [-12939197.0583, 4044613.1774], 
      [-12918344.3184, 4222325.3283], 
      [-12887065.2086, 3906909.4673], 
      [-8418433.3989, 5262954.0867], 
      [-8353363.7178, 5381714.5528], 
      [-8250336.7228, 5337002.1307], 
      [-8250336.7228, 5509587.1547]
    ]
  }
}