I am trying to display a pair of .shp/.dbf files in xamGeographicMap that gives the exception shown below when I try to load it. I am able to open this file set in ArcGIS and Google Earth Pro without any issues. My XAML is also shown below and I am using v14.2.20142.2024. Due to NDA and copyright agreements, I cannot upload the files, but what might cause this error in xamGeographicMap or what could I do to determine more information?
<ig:ShapefileConverter x:Key="fileSource" ImportCompleted="file_ImportCompleted" ShapefileSource="Q:\GIS\file.shp" DatabaseSource="Q:\GIS\file.dbf"> </ig:ShapefileConverter>
<ig:GeographicSymbolSeries x:Name="fileSeries" MarkerTemplate="{StaticResource fileMarker}" ItemsSource="{StaticResource fileSource}" LatitudeMemberPath="Lat" LongitudeMemberPath="Lon" VisibleFromScale=".01"> <ig:GeographicSymbolSeries.ToolTip> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> <TextBlock Text="{Binding Path=Item.Info, Converter={StaticResource Converter}}" Background="Aqua" /> </StackPanel> </ig:GeographicSymbolSeries.ToolTip> </ig:GeographicSymbolSeries>
System.Exception was unhandled HResult=-2146233088 Message=Corrupt Shp file - failed to read None Source=InfragisticsWPF4.Controls.Maps.XamGeographicMap.v14.2 StackTrace: at Infragistics.Controls.Maps.ShapeFileUtil.ReadShape(Header shapeHeader, BinaryReader shpReader, BinaryReader dbfReader) at Infragistics.Controls.Maps.ShapefileConverter.ParseShapes(BinaryReader shpReader, BinaryReader dbfReader) at Infragistics.Controls.Maps.ShapefileConverter.<ImportAsync>b__2(Object sender, GetBinaryReadersCompletedEventArgs e) at Infragistics.Controls.Maps.MultiUriProcessor.OnGetBinaryReadersCompleted(GetBinaryReadersCompletedEventArgs e) at Infragistics.Controls.Maps.MultiUriProcessor.<>c__DisplayClass2.<GetBinaryReadersAsync>b__0(Object sender, EventArgs e) at Infragistics.Controls.Maps.MultiUriProcessor.ProgressMonitor.OnCompleted() at Infragistics.Controls.Maps.MultiUriProcessor.ProgressMonitor.CheckComplete() at Infragistics.Controls.Maps.MultiUriProcessor.ProgressMonitor.RegisterComplete(Object part, Boolean complete) at Infragistics.Controls.Maps.MultiUriProcessor.<>c__DisplayClass4.<GetBinaryReadersAsync>b__1(Object sender, GetBinaryReaderCompletedEventArgs e) at Infragistics.Controls.Maps.UriProcessor.OnGetBinaryReaderCompleted(GetBinaryReaderCompletedEventArgs e) at Infragistics.Controls.Maps.UriProcessor.<GetBinaryReaderAsync>b__0(Object sender, OpenReadCompletedEventArgs e) at System.Net.WebClient.OnOpenReadCompleted(OpenReadCompletedEventArgs e) at System.Net.WebClient.OpenReadOperationCompleted(Object arg) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run() at GeoMapTest.App.Main() in c:\Projects\Sandbox\GeoMapTest\GeoMapTest\obj\Debug\App.g.cs:line 0 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.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:
Thanks Andrew, I have submitted this as a new feature. In order to get around this issue, I had to use a free .NET library called EasyGIS to read in the point data and write it out to a new shapefile.
Hello Gary,
Judging by the source code of the control, the shape types that are valid for reading into the XamGeographicMap are Point, Polygon, PolyLine, PolyLineZ, and PolyPointZ. If you currently try to read in other shape types, you will receive this exception. A workaround for this issue could be to pull the shapes that the XamGeographicMap does not currently support out of the shape file by using a shape file editor.
Alternatively, you could suggest a new product idea for some new functionality that will either implement or ignore these currently unsupported shape types to the XamGeographicMap. The website for suggesting a new product idea is http://ideas.infragistics.com/. Suggesting a new product idea will allow you to have direct communication with our product management team regarding your idea and you will receive notifications when new information regarding your idea becomes available.
Steps to create your idea:1. Log into the Infragistics Product Idea site at http://ideas.infragistics.com.2. Navigate to the product/platform channel of your choice(e.g. WPF, Windows Forms, ASP.NET, etc).3. Add your product idea and be sure to be specific and provide as much detail as possible.
The Product Idea site puts you in the driver's seat and allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thanks Rob, so based on the information above and looking at both Wikipedia (http://en.wikipedia.org/wiki/Shapefile) and the ERSI shapefile technical documentation (http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf), a "Null" shape type is valid in the file, but the xamGeographicMap does not support shapefiles containing that type, correct?
Any suggestions or workarounds I can try to surmount loading this into xamGeographicMap?
Thanks!
Hi Gary,
Andrew is out for the rest of the week but I can answer your question. Yes, the error message is generated by reading the shp file. The shape types (point, polyline, polygon, etc) that Andrew mentioned are things that are present inside of the shape file, not the dbf.
Hi Andrew, thanks for looking into this further. Just to verify, this error message is generated when reading in the .SHP file and NOT the .DBF file, correct?