I read in a JSON with multiple points. I want to create a polygon that contains all the points.
Seems there was a way to do this JS 3.X, https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=util_convexhull
I cannot find out how to do it 4.x
I don't want the map extent; the area is too large.
I've tried to do the extent of a Graphics Layer after adding the points, it defaults to +-180 / +-90.
I was trying to do the geometryService.ConvexHull and could not figure out how to properly insert the point geometries.
Any help is appreciated.
Solved! Go to Solution.
Hi there,
You can do it several different ways.
You can do it using geometryService.convexHull as mentioned above but it is requires a trip to a server.
You can use geometryEngineAsync.convexHull() method and the calculation will run on the client-side without having to go back to the server. I created a simple codepen to showcase how to use geometryEngineAsync's convexHull method.
If you are working with ArcGIS Online hosted feature service then you can take advantage of convex-hull-aggregrate statistics with query.
Hi there,
You can do it several different ways.
You can do it using geometryService.convexHull as mentioned above but it is requires a trip to a server.
You can use geometryEngineAsync.convexHull() method and the calculation will run on the client-side without having to go back to the server. I created a simple codepen to showcase how to use geometryEngineAsync's convexHull method.
If you are working with ArcGIS Online hosted feature service then you can take advantage of convex-hull-aggregrate statistics with query.