Hi All,
I am using ArcGIS runtime SDK(version 100.6) for .Net. I want to move a polygon feature from one location to other. Kindly suggest me that how to achieve this.
In fact I am looking for the option like to move and rotate and scale. In ArcObjects, by using ITransform2D method we can do almost all these things. Hence I feel it would be useful, if we have the similar method in ArcGIS runtime also.
> Iterating vertices will increase the execution time if the geometry has more number of vertices.
Sure but it's still extremely quick. Any out-of-the-box method we could provide would have to do the same thing.
Are you seeing a performance issue?
Hi Morten,
Thank for the response.
Iterating vertices will increase the execution time if the geometry has more number of vertices.
Without iterating through the vertices, is there any option like "ITransform2D method which is available in arcobjects"? So that we can move or rotate the geometry by using inbuilt functionality.
If you want to move it interactively, you can use the SketchEditor which supports dragging geometries around.
If you want to do it programmatically, you can use PolygonBuilder and iterate through the vertices and offset each vertex by a certain amount (this is actually what the SketchEditor does as you're dragging the feature around).
To move something you just need to update the geometry of the existing feature
var feature = //somehow get existing feature feature.Geometry = myNewGeometry; await feature.FeatureTable.UpdateFeatureAsync(feature);<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
In terms of how one would actually allow a user to choose an existing polygon and allow the user to move that depends on many factors.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.