I'm developing a webgis using ArcGIS Silverlight API 3.1 . I used esri interactive SDK sample for spatial query in the webgis .The problem is when i draw a freehand polygon and the polygon intersect itself (fig1), the error "Query failed: Error code '400':unable to complete operation." raised (fig2) . How can i solve the problem ?

fig1 fig2


1 Answer 1


I'm not an expert in Silverlight, the way to fix the geometry is to simplify it. Use ITopologicalOperator5, set the isknownsimple to false and then call simplify which will return a geometry with multiple parts - in this case 3 parts.

  • Thanks Michael but we can't use Arcobject in silverlight API
    – BBG_GIS
    Jun 11, 2014 at 6:08
  • That's a bummer. Do you have try..catch blocks in silverlight? Jun 11, 2014 at 21:33
  • The problem is that it can't solve query result.I don't have any result.
    – BBG_GIS
    Jun 12, 2014 at 3:59
  • That's true. But if your API can't handle non-simple geometries the only solution is to try..catch and return an error message. Ideally your API could fix it and solve the query but it appears that's not possible because you can't access low-level objects. Jun 12, 2014 at 4:09

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.