Dotspatial shapeEditor plugin error while editing existing shapefile

Jun 19, 2012 at 7:41 AM

Hi, i have included the shapeEditor plugin in my Dotnet C# Application. In my application, while i

open an existing shape file and trying to edit using the shapeEditor addshape control, iam

getting exception when adding a point to the existing shape file,it is,

System.IndexOutOfRangeException was unhandled
  Message=Index was outside the bounds of the array.
  Source=DotSpatial.Controls
  StackTrace:
       at DotSpatial.Controls.MapPointLayer.DrawFeatures(MapArgs e, IEnumerable`1 indices) in E:\ds\dotspatial-67663\DotSpatial.Controls\MapPointLayer.cs:line 478
       at DotSpatial.Controls.MapPointLayer.DrawFeatures(MapArgs args, List`1 indices, List`1 clipRectangles, Boolean useChunks) in E:\ds\dotspatial-67663\DotSpatial.Controls\MapPointLayer.cs:line 278
       at DotSpatial.Controls.MapPointLayer.DrawRegions(MapArgs args, List`1 regions) in E:\ds\dotspatial-67663\DotSpatial.Controls\MapPointLayer.cs:line 173
       at DotSpatial.Controls.MapFrame.Initialize(List`1 regions) in E:\ds\dotspatial-67663\DotSpatial.Controls\MapFrame.cs:line 294
       at DotSpatial.Controls.MapFrame.Initialize() in E:\ds\dotspatial-67663\DotSpatial.Controls\MapFrame.cs:line 325
       at DotSpatial.Controls.MapFrame.LayerCollection_MembersChanged(Object sender, EventArgs e) in E:\ds\dotspatial-67663\DotSpatial.Controls\MapFrame.cs:line 1198
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at DotSpatial.Data.ChangeEventList`1.OnItemChanged(Object sender) in E:\ds\dotspatial-67663\DotSpatial.Data\ChangeEventList.cs:line 306
       at DotSpatial.Data.ChangeEventList`1.ItemItemChanged(Object sender, EventArgs e) in E:\ds\dotspatial-67663\DotSpatial.Data\ChangeEventList.cs:line 289
       at DotSpatial.Symbology.LegendItem.OnItemChanged(Object sender) in E:\ds\dotspatial-67663\DotSpatial.Symbology\LegendItem.cs:line 513
       at DotSpatial.Symbology.FeatureLayer.OnApplyScheme(IFeatureScheme scheme) in E:\ds\dotspatial-67663\DotSpatial.Symbology\FeatureLayer.cs:line 2062
       at DotSpatial.Symbology.FeatureLayer.DataSetVerticesInvalidated(Object sender, EventArgs e) in E:\ds\dotspatial-67663\DotSpatial.Symbology\FeatureLayer.cs:line 294
       at DotSpatial.Data.FeatureSet.OnVerticesInvalidated() in E:\ds\dotspatial-67663\DotSpatial.Data\FeatureSet.cs:line 2576
       at DotSpatial.Data.FeatureSet.InvalidateVertices() in E:\ds\dotspatial-67663\DotSpatial.Data\FeatureSet.cs:line 792
       at DotSpatial.Plugins.ShapeEditor.AddShapeFunction.OnMouseUp(GeoMouseArgs e) in E:\ds\dotspatial-67663\DotSpatial.Plugins.ShapeEditor\AddShapeFunction.cs:line 305
       at DotSpatial.Controls.MapFunction.DoMouseUp(GeoMouseArgs e) in E:\ds\dotspatial-67663\DotSpatial.Controls\MapFunction.cs:line 157
       at DotSpatial.Controls.Map.OnMouseUp(MouseEventArgs e) in E:\ds\dotspatial-67663\DotSpatial.Controls\Map.cs:line 1629
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.UserControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at DSMAP.Program.Main() in E:\docs\DSMap1\DSMAP\DSMAP\Program.cs:line 18
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

and also while adding a Line shape , it is drawing a line but not being saved,

please help me in this issue,

Thanking you

Regards

bala gangadhar S

 

Developer
Jul 3, 2012 at 5:56 PM

I've noticed that the ShapeEditor plugin frequently a source of exceptions (it is also widely used). This could be an issue there or in MapPointLayer.

Sep 12, 2012 at 5:21 AM

Did you ever get to the bottom of this issue, I'm getting the same sort of error

Regards