editing multipoint

1031
4
09-07-2011 10:06 PM
ArneDahlman
New Contributor III
I have a editable feature layer in my map.
So far I have encountered three problems.

1. I add a new feature using the add tool. When hitting save I get error "Unable to complete operation".
In fiddler I can se that geometry is sent as a point, not multipoint.
Error message in fiddler: {"error":{"code":400,"message":"Unable to complete operation.","details":["Invalid graphic features","Invalid parameters"]}}
I can add multipoints using REST. So I guesss the service is OK.

2. When trying to use the vertex editing tool, I get a crash. See attatched screen dump.

3. The union tool is disabled. I works for point, polygon and polyline.

Tools from XAML:
<Button x:Name="AddButton" Margin="2" ToolTipService.ToolTip="Rita ny" Command="{Binding Add}">
   <Image Source="/images/pencil_add.png" Stretch="UniformToFill" Height="16" Width="16" />
</Button>
<Button x:Name="EditVerticesButton" Margin="2" ToolTipService.ToolTip="Brytpunktsredigera" Command="{Binding EditVertices}" IsEnabled="False" >
   <Image Source="/images/shape_handles.png" Stretch="UniformToFill" Height="16" Width="16" />
</Button>
<Button x:Name="UnionButton" Margin="2" ToolTipService.ToolTip="Slå ihop markerade till en geometri" Command="{Binding Union}" >
   <Image Source="/images/shape_union.png" Stretch="UniformToFill" Height="16" Width="16" />
</Button>

FeatureLayer from XAML:
<esri:FeatureLayer ID="PolytaxHänsynPunktTest" DisableClientCaching="True"
  AutoSave="False"
  Url="http://ags1int/ArcGIS/rest/services/msdedit/editVisaPolytaxTest/FeatureServer/0"
  OutFields="*"
  Mode="OnDemand" />


I'am using api 2.2.
Any Ideas?
0 Kudos
4 Replies
JenniferNery
Esri Regular Contributor
The API does not support editing MultiPoint geometries. What you can do is subscribe to Editor.EditCompleted event and update the graphic.Geometry before it is saved.
private void Editor_EditCompleted(object sender, ESRI.ArcGIS.Client.Editor.EditEventArgs e)
{
 foreach (var edit in e.Edits)
 {
  if (edit.Graphic != null && edit.Graphic.Geometry is MapPoint)
  {
   var multiPointGeom = new MultiPoint();
   multiPointGeom.Points.Add(edit.Graphic.Geometry as MapPoint);
   edit.Graphic.Geometry = multiPointGeom;
  }
 }
}


You might also want to try this sample for Union: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Union
0 Kudos
ArneDahlman
New Contributor III
Thank you for your reply.

OK, this may be a workaround.

Is there any future plans for supporting multipoints?

I think that this is some basic functionality that one would expect to find in a GIS application.
0 Kudos
JenniferNery
Esri Regular Contributor
Thank you for your feedback, I forwarded your request to the team for consideration.
0 Kudos
GaryBushek
New Contributor III
Jennifer,
   I'm not editing points but I am trying to union point selections when the user chooses "add to selection" in my application.  The union operation doesn't seem to work for multipoint features which sounds kind of like what you were talking about here. But like I said, im not editing points. Can you verify that points cannot be "unioned" to multi point features?  When the user chooses "New Selection" and selects several points, all the individual point features seem to union into one multipoint feature fine.  It's just this "Add to Selection" and the operation of merging point(s) with multipoints that doesn't work for me. Your help is appreciated.  🙂

Gary
0 Kudos