Select to view content in your preferred language

EditGeometry for Points

1357
4
01-12-2012 12:59 PM
WilliamKimrey
Emerging Contributor
Hello all,

I'm trying to use the EditGeometry class to edit the geometry of a Point Feature on my FeatureLayer.  Specifically, I only need to move the point a couple of inches.  More times than not, it'll also only be in one direction.  For instance, I might need to shift a point 2 inches along the Y-axis,  but leave the X-axis alone.

Because the measurements have to be as precise as I can make them, I'm trying to use EditGeometry as opposed to the EditVertices tool on the Editor Widget. Is this the correct tool to be using?  Or should I try and do this through a WCF service instead?

Thanks for the assistance,
Will
0 Kudos
4 Replies
JenniferNery
Esri Regular Contributor
If you moving the point location is interactive, you can use Editor.EditVertices command or EditorWidget.EditVertices http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitEditorWidget. After you click on the EditVertices button, you can start dragging the point feature to its new location.

EditGeometry only support polyline, polygon, envelope geometries. Thus, point geometries are handled separately as seen in this SDK sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsGeometry.
        private void MyMap_MouseMove(object sender, MouseEventArgs e)
        {
            if (selectedPointGraphic != null)
                selectedPointGraphic.Geometry = MyMap.ScreenToMap(e.GetPosition(MyMap));          
        }
0 Kudos
WilliamKimrey
Emerging Contributor
That was the sample I was looking at initially.  It looks like I'm not going to be able to use EditGeometry then if it does not work with Points.  The geometry edits I need to make are too small and precise to do by dragging the point with the mouse.  Guess I'll try a WCF service.

Thanks,
Will
0 Kudos
JenniferNery
Esri Regular Contributor
If you know the new geometry (X,Y), you can just set graphic.Geometry = new MapPoint(X, Y, MyMap.SpatialReference); You don't need to handle MouseMove.
0 Kudos
WilliamKimrey
Emerging Contributor
Yeah, that's what I ended up doing.  My confusion was when I was trying to edit the existing geometry of a point instead of setting the geometry to a new point.  Simple mistake that I should have seen, but for some reason I completely missed it.

Thanks for the asisstance,
Will
0 Kudos