0

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" : {
    "attr1":"10008201",
    "attr2":"9",
    "attr3":"PMS"
  },
  "geometry" : {
    "type":"polygon",
    "rings":[[[8487016.789333614,1464112.0521501263],[8668631.168539183,1622489.5747570037],[8668631.168539183,1622489.5747570037],[8487016.789333614,1464112.0521501263]]],
    "_ring":0,
    "spatialReference":{"wkid":102100,"latestWkid":3857}

  }
}

]

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

1
  • 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

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.