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 APIBBG_GIS– BBG_GIS2014年06月11日 06:08:00 +00:00Commented Jun 11, 2014 at 6:08
-
That's a bummer. Do you have try..catch blocks in silverlight?Michael Stimson– Michael Stimson2014年06月11日 21:33:26 +00:00Commented Jun 11, 2014 at 21:33
-
The problem is that it can't solve query result.I don't have any result.BBG_GIS– BBG_GIS2014年06月12日 03:59:35 +00:00Commented 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.Michael Stimson– Michael Stimson2014年06月12日 04:09:43 +00:00Commented Jun 12, 2014 at 4:09
Explore related questions
See similar questions with these tags.