We've been trying to use a geometry server to calculate a convex hull of geometries, however our request gives a 400 error. This is even seen in the example request found at
https://developers.arcgis.com/rest/services-reference/enterprise/convex-hull.htm
For reference this is the URL using the tasks URL:
Does anyone know what is causing the error?
Hello,
It is recommended that you create a geometry service object for use within your applications.
var geometryService = new esri.tasks.GeometryService("https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
//calculate the convex hull
var points = dojo.map(features,function(feature){
return feature.geometry;
});
geometryService.convexHull(points,function(result){
var symbol;
switch(result.type){
case "point":
symbol = new esri.symbol.SimpleMarkerSymbol();
break;
case "polyline":
symbol = new esri.symbol.SimpleLineSymbol();
break;
case "polygon":
symbol = new esri.symbol.SimpleFillSymbol();
break;
}
map.graphics.add(new esri.Graphic(result,symbol));
},function(error){
console.log("An error occured during convex hull calculation");
});