I am getting an error on a few customer machines during the GetFeaturesWithinDistanceOf() method. It seems to be coming from a sort method run within the NetTopologySuite DLL. The DLL version is 1.7.3.31740, which looks like it hasn’t changed in a long time, so I doubt it’s a bug in that code.
parcels = parcelLayer.QueryTools.GetFeaturesWithinDistanceOf( selectedShape.GetShape(),
Map.MapUnit, unit, radius,
ReturningColumnsType.NoColumns );
This is the code I’m using, pretty straight forward. I cannot reproduce this on my dev machine, so I am not sure what’s going on. This happens on windows 7 client machines.
I noticed There are a couple unresolved threads also with this issue: thinkgeo.com/forums/MapSuite/tabid/143/aft/8725/Default.aspx and thinkgeo.com/forums/MapSuite/tabid/143/aft/10614/Default.aspx
Neither of which were reproducible, which is the predicament I’m in as well.
Here’s the massive call stack:
Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. x: ‘GisSharpBlog.NetTopologySuite.Index.Strtree.ItemBoundable’, x’s type: ‘ItemBoundable’, IComparer: ‘GisSharpBlog.NetTopologySuite.Index.Strtree.STRtree+AnonymousXComparerImpl’.
at System.Array.SorterObjectArray.QuickSort(Int32 left, Int32 right)
at System.Array.Sort(Array keys, Array items, Int32 index, Int32 length, IComparer comparer)
at System.Collections.ArrayList.Sort(Int32 index, Int32 count, IComparer comparer)
at System.Collections.ArrayList.Sort(IComparer comparer)
at GisSharpBlog.NetTopologySuite.Index.Strtree.STRtree.CreateParentBoundables(IList childBoundables, Int32 newLevel)
at GisSharpBlog.NetTopologySuite.Index.Strtree.AbstractSTRtree.CreateHigherLevels(IList boundablesOfALevel, Int32 level)
at GisSharpBlog.NetTopologySuite.Index.Strtree.AbstractSTRtree.Build()
at GisSharpBlog.NetTopologySuite.Index.Strtree.AbstractSTRtree.Query(Object searchBounds)
at GisSharpBlog.NetTopologySuite.Index.Strtree.STRtree.Query(IEnvelope searchEnv)
at GisSharpBlog.NetTopologySuite.Noding.MCIndexNoder.IntersectChains()
at GisSharpBlog.NetTopologySuite.Noding.MCIndexNoder.ComputeNodes(IList inputSegStrings)
at GisSharpBlog.NetTopologySuite.Operation.Buffer.BufferBuilder.ComputeNodedEdges(IList bufferSegStrList, IPrecisionModel precisionModel)
at GisSharpBlog.NetTopologySuite.Operation.Buffer.BufferBuilder.Buffer(IGeometry g, Double distance)
at GisSharpBlog.NetTopologySuite.Operation.Buffer.BufferOp.BufferOriginalPrecision()
at GisSharpBlog.NetTopologySuite.Operation.Buffer.BufferOp.ComputeGeometry()
at GisSharpBlog.NetTopologySuite.Operation.Buffer.BufferOp.Buffer(IGeometry g, Double distance, Int32 quadrantSegments, BufferStyle endCapStyle)
at ThinkGeo.MapSuite.Core.BaseShape./xo=(Double ABs=, Int32 ARs=, BufferCapType Ahs=)
at ThinkGeo.MapSuite.Core.BaseShape.BufferCore(Double distance, Int32 quadrantSegments, BufferCapType bufferCapType, GeographyUnit shapeUnit, DistanceUnit distanceUnit)
at ThinkGeo.MapSuite.Core.BaseShape.Buffer(Double distance, GeographyUnit shapeUnit, DistanceUnit distanceUnit)
at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesWithinDistanceOfCore(BaseShape targetShape, GeographyUnit unitOfData, DistanceUnit distanceUnit, Double distance, IEnumerable`1 returningColumnNames)
at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesWithinDistanceOf(BaseShape targetShape, GeographyUnit unitOfData, DistanceUnit distanceUnit, Double distance, IEnumerable`1 returningColumnNames)
at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesWithinDistanceOf(BaseShape targetShape, GeographyUnit unitOfData, DistanceUnit distanceUnit, Double distance, ReturningColumnsType returningColumnNamesType)
at ThinkGeo.MapSuite.Core.QueryTools.GetFeaturesWithinDistanceOf(BaseShape targetShape, GeographyUnit unitOfData, DistanceUnit distanceUnit, Double distance, ReturningColumnsType returningColumnNamesType)
at BSASoftware.GIS.Forms.Controls.Base.MapControlBase.TrackOverlay_TrackEnded(Object sender, TrackEndedTrackInteractiveOverlayEventArgs e)
at ThinkGeo.MapSuite.WpfDesktopEdition.TrackInteractiveOverlay.OnTrackEnded(TrackEndedTrackInteractiveOverlayEventArgs e)
at ThinkGeo.MapSuite.WpfDesktopEdition.TrackInteractiveOverlay.eBk=()
at ThinkGeo.MapSuite.WpfDesktopEdition.TrackInteractiveOverlay.MouseClickCore(InteractionArguments interactionArguments)
at ThinkGeo.MapSuite.WpfDesktopEdition.InteractiveOverlay.MouseClick(InteractionArguments interactionArguments)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.zBY=(InteractionArguments zRY=)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.yRY=(Object yhY=, MouseButtonEventArgs yxY=)
at ohM=.qhg=.OnSingleClick(Object sender, MouseButtonEventArgs e)
at ohM=.qhg=.Ixk=(Object JBk=, MouseButtonEventArgs JRk=)
at ohM=.qhg=.Jhk=(Object Jxk=, EventArgs KBk=)
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
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.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, 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.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.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(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 BSASoftware.Assessing.Program.Main(String[] args)