Feb 1, 2011 at 8:34 PM

I am getting this error when choosing the Identify funtion and selecting an object on the screen. The same error appears in the DemoMap.exe

Selecting nothing shows an empty FeatureIdentifier screen with the 2 layers in my map shown in the node list.

Selecting a Line feature displays my data correctly.

Selecting nothing after selecting a Line feature shows the last line feature selected?

Selecting a Point feature produces an error as shown below. Any ideas?

Call stack location:

DotSpatial.Controls.dll!DotSpatial.Controls.Map.OnMouseUp(System.Windows.Forms.MouseEventArgs e) Line 1517


System.IO.IOException was unhandled
  Message=An attempt was made to move the file pointer before the beginning of the file.

       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileStream.SeekCore(Int64 offset, SeekOrigin origin)
       at System.IO.FileStream.Seek(Int64 offset, SeekOrigin origin)
       at DotSpatial.Data.AttributeTable.SupplyPageOfData(Int32 lowerPageBoundary, Int32 rowsPerPage) in c:\Dev\DotSpatial\DotSpatial.Data\DotSpatial.Data\AttributeTable.cs:line 1178
       at DotSpatial.Data.Shapefile.GetAttributes(Int32 startIndex, Int32 numRows) in c:\Dev\DotSpatial\DotSpatial.Data\DotSpatial.Data\Shapefile.cs:line 435
       at DotSpatial.Controls.FeatureIdentifier.Add(IFeatureLayer layer, Extent bounds) in c:\Dev\DotSpatial\DotSpatial.Controls\DotSpatial.Controls\FeatureIdentifier.cs:line 266
       at DotSpatial.Controls.MapFunctionIdentify.Identify(IEnumerable`1 layers, Extent strict, Extent tolerant) in c:\Dev\DotSpatial\DotSpatial.Controls\DotSpatial.Controls\MapFunctionIdentify.cs:line 103
       at DotSpatial.Controls.MapFunctionIdentify.OnMouseUp(GeoMouseArgs e) in c:\Dev\DotSpatial\DotSpatial.Controls\DotSpatial.Controls\MapFunctionIdentify.cs:line 76
       at DotSpatial.Controls.MapFunction.DoMouseUp(GeoMouseArgs e) in c:\Dev\DotSpatial\DotSpatial.Controls\DotSpatial.Controls\MapFunction.cs:line 157
       at DotSpatial.Controls.Map.OnMouseUp(MouseEventArgs e) in c:\Dev\DotSpatial\DotSpatial.Controls\DotSpatial.Controls\Map.cs:line 1516
       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(ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at DVMS_GIS.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       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()

Feb 23, 2011 at 4:20 PM
Edited Feb 26, 2011 at 2:04 PM


I have no error with DotSpatial 12-15-2010 but if field name is set, value is empty, so I'm interested too.


PS : I reloaded the shape and it's ok. 

Feb 26, 2011 at 2:06 PM

I just realized that you tried perhaps to do more than I, I just set FunctionMode=FunctionMode.Info to display result. Can you add your piece of code, I'll try also.

May 9, 2011 at 9:28 AM

I AM HAVING SIMILAR ISSUES: please see detailed description below:

Here is my trouble:

Selecting a Feature and return it's FID or other fields to code for further processing - HELP NEEDED!

I am developing a custom GIS application using MapWindow in .net framework C#.

I have been able to link up everything including map, toolstrip, statusbar etc. Everything works as expected when I run the program and load my shape file to the map.

My shape file has fields like FID, longitude, latitude, address, name, population etc.

My challenge now is to read this data everytime I click on a particular feature in that shape.

I have tried an event of the map control: map1_SelectionChanged(object sender, EventArgs e) but this does not return the item or feature selected.

Any help o this will be greatly appreciated.


In case you don't understand the picture, I will rephrase it here:

I am trying to read the attributes of features whenever I click on them (by code in C# or VB). Here is my code:

private void map1_SelectionChanged(object sender, EventArgs e)


MapWindow.Data.IFeature feat =



the problem is that the eventArgs - e, does not give me the selected index of the feature that was clicked upon. If I change the value of 'index' above to a number, say 21, I actually get the feature with index of 21 and from them I could get the recordset to display on a form; which is really what I am interested in. PLZ help. I am stuck.