ApplyEdits geometry from javascript API

3298
2
Jump to solution
08-04-2015 08:42 AM
Lars_HalvorAnundskaas
Deactivated User

Hi,

I drew a graphic on a graphic layer (sample)

Capture.PNG

When running this through applyEdits on a featureLayer i get a success in return, but the geometry in the database becomes null or invalid.

If I draw a simple square or a circle, I don't see the same problem.

I also tried to take the same geometry into arcmap using json to features, the geometry appears correctly.

I have attached a sample JSON which does not work through applyEdits (even though it returns success and attributes are saved)

However, the shape looks perfectly well when importing using json to features.

Any hints on what could I could do wrong?

0 Kudos
1 Solution

Accepted Solutions
Lars_HalvorAnundskaas
Deactivated User

10.3.1 did not give me any error message, but 10.2.1 did:

The solution; to run simplify on the geometry when necessary

if (esri.geometry.polygonSelfIntersecting(geom)) {

      geom = geometryEngine.simplify(geom);

}

Simplify a polygon | ArcGIS API for JavaScript

View solution in original post

0 Kudos
2 Replies
Lars_HalvorAnundskaas
Deactivated User

10.3.1 did not give me any error message, but 10.2.1 did:

The solution; to run simplify on the geometry when necessary

if (esri.geometry.polygonSelfIntersecting(geom)) {

      geom = geometryEngine.simplify(geom);

}

Simplify a polygon | ArcGIS API for JavaScript

0 Kudos
KenBuja
MVP Esteemed Contributor

Has polygonSelfIntersecting been replaced by the polygon method isSelfIntersecting?

0 Kudos