Convex Hull

URL:
https://<root>/Utilities/Geometry/GeometryServer/convexHull
Methods:
GET
Version Introduced:
10.0

Description

The convexHull operation is performed on a geometry service resource. It returns the convex hull of the input geometries. The input geometries can be points, multipoints, polylines, or polygons, but they all must be the same type. The convex 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 following parameters table.

Request parameters

ParameterDetails

geometries

Specifies the geometries whose convex hull is to be created. The structure of each geometry is the same as the structure of the JSON geometry objects returned by ArcGIS REST API.

Syntax:

1
2
3
4
{
  "geometryType" : "<esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon>"
  "geometries" : [ <geometry1>, <geometry1>, ..., <geometryN> ]
}

Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
  "geometryType" : "esriGeometryPolyline",
    "geometries" :
  [
    {
      "paths" :
      [
        [[-117,34],[-116,34],[-117,33]],
        [[-115,44],[-114,43],[-115,43]]
      ]
    },
    {
      "paths" :
      [
        [[32,17],[31,17],[30,17],[30,16]]
      ]
    }
  ]
}

sr

Specifies the well-known ID (WKID) or a spatial reference JSON object for the output geometry. For a list of valid WKID values, see Using spatial references.

f

The response format. The default response format is html.

Values: html | json | pjson

Example usage

The following is a decoded sample request URL (the actual URL must be encoded) for convexHull:

https://sampleserver6.arcgisonline.com/ArcGIS/rest/Utilities/services/Geometry/GeometryServer/convexHull?geometries={"geometryType":"esriGeometryPoint","geometries":[{"x":-117,"y":34},{"x":-116.5,"y":34.5},{"x":-116,"y":33}]}&sr=4326&f=html

JSON Response syntax

1
2
3
4
{
  "geometryType" : "<esriGeometryPoint | esriGeometryMultipoint | esriGeometryPolyline | esriGeometryPolygon>"
  "geometry" : { <geometry1> }
}

JSON Response example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
 "geometryType": "esriGeometryPolygon",
 "geometry": {"rings": [[
  [
   -116,
   33
  ],
  [
   -117,
   34
  ],
  [
   -116.5,
   34.5
  ],
  [
   -116,
   33
  ]
 ]]}
}

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

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close