ThinkGeo.com    |     Documentation    |     Premium Support

Nautical Charts Exception

US3GC01M.zip (747.1 KB)

Hi,

I’m using NOAA provided navigational charts, but I’m having some problems with hard crashes. I’ve attached one example file. Zoom in on the chart a couple times and you should get the following error. I do not get this error at all using the Hawaii sample from the demo.

System.AggregateException
HResult=0x80131500
Message=One or more errors occurred.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Func4 bodyWithLocal, Func1 localInit, Action1 localFinally) at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IList1 list, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally) at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable1 source, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally) at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable1 source, Action1 body) at ThinkGeo.MapSuite.Layers.NauticalChartsFeatureLayer.DrawCore(GeoCanvas canvas, Collection1 labelsInAllLayers)
at ThinkGeo.MapSuite.Layers.Layer.uyc=(GeoCanvas canvas, Collection1 labelsInAllLayers) at ThinkGeo.MapSuite.Layers.Layer.Draw(GeoCanvas canvas, Collection1 labelsInAllLayers)
at ThinkGeo.MapSuite.WinForms.LayerOverlay.DrawCore(GeoCanvas canvas)
at ThinkGeo.MapSuite.WinForms.Overlay.lVU=(GeoCanvas canvas)
at ThinkGeo.MapSuite.WinForms.Overlay.Draw(GeoCanvas canvas)
at ThinkGeo.MapSuite.WinForms.WinformsMap.TlU=(IEnumerable`1 drawingOverlays, RectangleShape extent)
at ThinkGeo.MapSuite.WinForms.WinformsMap.TVU=(RectangleShape drawingExtent, RectangleShape extent)
at ThinkGeo.MapSuite.WinForms.WinformsMap.bFU=(RectangleShape extent)
at ThinkGeo.MapSuite.WinForms.WinformsMap.IRk=(Int32 delayInterval, RectangleShape extent)
at ThinkGeo.MapSuite.WinForms.WinformsMap.VVU=(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Control.UpdateBounds()
at System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
at System.Windows.Forms.Control.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)

This exception was originally thrown at this call stack:
System.ThrowHelper.ThrowArgumentException(System.ExceptionResource)
System.Collections.Generic.Dictionary<TKey, TValue>.Insert(TKey, TValue, bool)
System.Collections.Generic.Dictionary<TKey, TValue>.Add(TKey, TValue)
nhc=.X04=.X04=()

Inner Exception 1:
TypeInitializationException: The type initializer for ‘nhc=.X04=’ threw an exception.

Inner Exception 2:
ArgumentException: An item with the same key has already been added.

Regards,
Damian

Damian,
Could you create a private ticket and provide us the data file. We could look into the more detail.

Thanks

Frank

How do I create a private ticket? I don’s see any flag to do so.

The attachment to the initial post is all you need.

Regards,
Damian

Thanks Damian,
Sorry overlook the attachment. I did some test with your data it work fine with zoom in/out.

https://youtu.be/QegY6ct59fw.

Attachment is my demo project.

HelloWorld.zip (1.5 MB)

Thanks

Frank

Hi Frank,

Just figured it out. I am setting some defaults when adding these images because certain things don’t seem to show up same if you don’t.

This is the specific trigger to get the crash.

nc.SymbolDisplayMode = NauticalChartsSymbolDisplayMode.PaperChart;

Thanks,
Damian

Thanks Damian,
Good to know it works. By the way we have another demo project for the Nautical Charts.

In case you need it.

Thanks

Frank

Hi Frank,

I didn’t mean it was fixed. I just meant that I found the condition in which it crashes. I want to be able to set the SymbolDisplayMode, but that’s what is causing the crash when changed to PaperChart type.

Yes, that’s a nice demo project.

Regards,
Damian

Thanks Damian,
We have fixed the issue. Please get the latest nugget beta package. You can set
nc.SymbolDisplayMode = NauticalChartsSymbolDisplayMode.PaperChart;

Thanks

Frank

Hi Frank,

Looks good. Thank you.

Regards,
Damian

Thanks Damian,
Good to know it work. Go ahead let us know if you have any more questions.

Thanks

Frank