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

Description

The convexHull operation is performed on a geometry service resource. It returns the convex hull of the input geometry. The input geometry can be a point, multipoint, polyline or polygon. The hull is typically a polygon but can also be a polyline or point in degenerate cases.

You can provide arguments to the convexHull 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 geometries whose convex hull is to be created. The structure of geometry is same as the structure of the JSON geometry objects returned by the ArcGIS REST API.

Syntax and Examples:

JSON Structures:

Syntax:
{
"geometryType" : "<esriGeometryPoint | esriGeometryPolyline | esriGeometryPolygon | esriGeometryMultipoint>",
"geometries" : [ <geometry1>, <geometry2> ]
}
Example:
{
"geometryType" : "esriGeometryPolyline",
"geometries" : [
 {
   "paths" : [
    [[-117,34],[-116,34],[-117,33]],
    [[-115,44],[-114,43],[-115,43]]
   ]
 },
{
  "paths" : [
  [[32.49,17.83],[31.96,17.59],[30.87,17.01],[30.11,16.86]]
 ]
}
]
}
        
sr Description: The well-known ID or a spatial reference json object for the output geometry. For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems.

Example Usage

Example 1: In this example, Convex Hull is computed for three points.

http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/convexHull?
sr=4326
&geometries={"geometryType":"esriGeometryPoint","geometries":[{"type":"point","x":-117.2332208251953,"y":34.086152645433316,"spatialReference":{"wkid":4326}},{"type":"point","x":-117.21536804199218,"y":34.0854659999255,"spatialReference":{"wkid":4326}},{"type":"point","x":-117.22498107910155,"y":34.06623992570675,"spatialReference":{"wkid":4326}}]}
&f=HTML

JSON Response Syntax

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

JSON Response Example

{
  "geometryType" : "esriGeometryPolygon", 
  "geometry" : 
  {
    "rings" : 
    [
      [
        [-117.224981079102, 34.0662399257068], 
        [-117.233220825195, 34.0861526454333], 
        [-117.215368041992, 34.0854659999255], 
        [-117.224981079102, 34.0662399257068]
      ]
    ]
  }
}