Select to view content in your preferred language

Reshape overlapping polygons after editing vertices

743
6
11-22-2011 07:19 AM
ArtUllman
Emerging Contributor
I am working on an application that allows users to update polygons using the Editor Class (not the Editorwidget) and the EditVertices function.  After a user updates a polygon, they may overlap an adjoining polygon.  I take the resulting geometry and query for all polygons that overlap.  I would like to use the Reshape Function to reshape these overlapping polygons based on the new geometry.  How can I call call the reshape function in code to modify these overlapping polygons. 

I would think this is something that alot of developers would need to do in an online editing situation.

Thanks.
0 Kudos
6 Replies
WeifengHe
Esri Contributor
If you have an array of polygons need to be reshaped, call IGeometryServer2.Reshape method will do the job, using the boundary of the new polygon as input polyline.

You can also call ITopologicalOperator.Difference to work on one polygon at a time.
0 Kudos
ArtUllman
Emerging Contributor
I am coding in a silverlight application, so I do not have access to arcobjects classes. Geometry services have a reshape function, which I was going to try.  However, I know that the Editor class in Silverlight has a Reshape tool, but I am looking for some information on how to use it to reshape one polygon after changing another polygon using editvertices.

Here is what I am trying to figure out.  Editor has a Reshape ICommand property.  I can't find any sample or documentation showing how to call Reshape from code.
0 Kudos
JenniferNery
Esri Regular Contributor
You can look at the following SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Reshape.
You might also want to check AutoComplete: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AutoComplete

The interactive way to reshape or auto complete a polygon would be to use Editor.Reshape or Add command, respectively. http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsAutoSave. If AutoSelect is checked or after you have made selections, you can add near the selected feature and auto-complete against the selected feature. You can also reshape selected feature by drawing a polyline cutter.
0 Kudos
ArtUllman
Emerging Contributor
Thanks.  I am going to call the Geometry Service as described in the sample.  I was thinking that I could use the Editor class in code rather than interactively, but I can not find any good explanation of how to do this.  The geometry service should do the trick.
0 Kudos
JenniferNery
Esri Regular Contributor
You can call Reshape in code-behind, but drawing the cutter is still interactive.

if(editor.Reshape.CanExecute(null)) // this is true if there are selected features
    editor.Reshape.Execute(null); // activates Reshape, you can begin drawing the cutter.


If you already have the cutter, you can use GeometryService to do Reshape.
0 Kudos
ArtUllman
Emerging Contributor
Thanks.  I wrote a solution using the geometry service.  I want the operation to run without user interaction.   I was curious if I could run the editor.Reshape without user interaction and you answered my question. Thank you for your assistance.
0 Kudos