I have an problem with "Query Task" class of ESRI Sliverlight API 2.1 version.
I am saving a polygon with 2 exclusions [Inner rings] (i.e. say exlcusion 'A' as 4 vertices and exclusion 'B' with 5 vertices) into SDE database.When I do a Sliverlight ESRI query task to retrive the same shape, am getting exclusion B as first inner ring and exclusion A as second inner ring.How do I get a polygon rings (inner) in same order as I saved into database. I have tried Simplify method but still no luck.
Note: shapes from sliverlight has been saved to SDE using GP Tools where inner rings are added into geometry bag in same order and stored in geodatabase.
Let me know if any questions. Posted in ESRI forums no help as on today hence posting here.
From Silverlight client am sending polygon as feature set to store in SDE using GP Tool. In the ArcObjects part of the code, we create the rings and add them to a IGeometry
array. The outermost ring gets added first, followed by the inner rings(in the same order in which they were created). Finally IGeometryBridge.AddGeometries
method was used to build a polygon from array of rings.
When we check the interior ring order after creation of the polygon geometry, it reflects the same order in which it was created in the Silverlight API. But once we store it in a SDE geodatabase featureclass, immediately the interior ring order gets modified.
I have asked same question in ESRI Forum. ESRI expert saying that order of rings will be changed for performance reasons while storing in SDE. Because of this when I query the same polygon using query task of Silverlight API, order of rings are changed.
If you look into ArcObjects, I can get order in same way using
SimplifyPreserveFromTo((ITopologicalOperator4)inputPoly).IsKnownSimple_2 = false;
inputPoly.SimplifyPreserveFromTo();
What is equivalent of SimplifyPreserveFromTo
in ESRI Silverlight, or any best approach to get rings in same order.
Here important point - rings are not changed always, some times I am getting correct order while retriving from query task of Silverlight API.