I have a polygon layer in ArcGIS Online,

When I draw a polygon by taking P1 as starting point and double click on the P2 so polygon draw end event will come from draw tool.

The below is the JSON format which I used to addFreature.

  "attributes" : {
  "geometry" : {



The addFeature service says sucess. But the geometry of that feature is not saved in the ArcGIS Online layer.

So, I am thinking the polygon geometry is invalid so its not saving. But how to validate it from JavaScript API

  • 2
    The minimum number of points in a polygon is THREE. The minimum number of vertices in a ring is FOUR (first verrtex == last vertex)
    – Vince
    Dec 17, 2016 at 12:42

1 Answer 1


i think the method you're looking for is geometryEngine.simplify()

From the API reference:

Performs the simplify operation on the geometry which alters the given geometries to make their definitions topologically legal with respect to their geometry type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.