Hello everyone,
For my application, I have the possibility to select a multipolygon but I reach an exception when I try to do it.
This is my multipolygon :
When I use this code, it reach an exception :
private void winformsMap1_Click(object sender, MapClickWinformsMapEventArgs e)
{
InMemoryFeatureLayer layer = GetLayer(item.Text);
layer.Open();
Collection<Feature> selectedFeatures = layer.QueryTools.GetFeaturesContaining(e.WorldLocation, columns);
layer.Close();
......
}
This is the exception (reach with this => e.WorldLocation) :
And the detail :
GisSharpBlog.NetTopologySuite.Geometries.TopologyException was unhandled
Message="side location conflict [ (-43.9453125, -24.9850769042969, NaN) ]"
Source="NetTopologySuite"
StackTrace:
at GisSharpBlog.NetTopologySuite.GeometriesGraph.EdgeEndStar.PropagateSideLabels(Int32 geomIndex)
at GisSharpBlog.NetTopologySuite.GeometriesGraph.EdgeEndStar.ComputeLabelling(GeometryGraph[] geom)
at GisSharpBlog.NetTopologySuite.Operation.Relate.RelateComputer.LabelNodeEdges()
at GisSharpBlog.NetTopologySuite.Operation.Relate.RelateComputer.ComputeIM()
at GisSharpBlog.NetTopologySuite.Operation.Relate.RelateOp.get_IntersectionMatrix()
at GisSharpBlog.NetTopologySuite.Operation.Relate.RelateOp.Relate(IGeometry a, IGeometry b)
at GisSharpBlog.NetTopologySuite.Geometries.Geometry.Relate(IGeometry g)
at GisSharpBlog.NetTopologySuite.Geometries.Geometry.Contains(IGeometry g)
at ThinkGeo.MapSuite.Core.BaseShape.ContainsCore(BaseShape targetShape)
at ThinkGeo.MapSuite.Core.BaseShape.Contains(BaseShape targetShape)
at ThinkGeo.MapSuite.Core.FeatureSource.x50350872fb80508b(BaseShape xb513c0b05488b8ed, IEnumerable`1 x8ad42fcdfcf2a001)
at ThinkGeo.MapSuite.Core.FeatureSource.SpatialQueryCore(BaseShape targetShape, QueryType queryType, IEnumerable`1 returningColumnNames)
at ThinkGeo.MapSuite.Core.FeatureSource.SpatialQuery(BaseShape targetShape, QueryType queryType, IEnumerable`1 returningColumnNames)
at ThinkGeo.MapSuite.Core.QueryTools.GetFeaturesContaining(BaseShape targetShape, IEnumerable`1 returningColumnNames)
at TestModuleCartto.Form1.winformsMap1_Click(Object sender, MapClickWinformsMapEventArgs e) in C:\Documents and Settings\Pad.GEO6\Mes documents\Visual Studio 2008\Projects\TestModuleCarto\TestModuleCartto\Form1.cs:line 256
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.OnMapClick(MapClickWinformsMapEventArgs e)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x1e882ae98c96da8b(InteractionArguments x195facd4ef5d753d)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xfeca3317d3c75bbb(Object xd9272088e65bd176, x6a8380ab1a7ebb4c xc2fd4c0ed406cdb7)
at ThinkGeo.MapSuite.DesktopEdition.x5cd462d41be2f68a.OnMouseEvent(x6a8380ab1a7ebb4c e)
at ThinkGeo.MapSuite.DesktopEdition.x5cd462d41be2f68a.x9726bb53ed7f1ead(Object xd9272088e65bd176, EventArgs xc2fd4c0ed406cdb7)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.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(Int32 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 TestModuleCartto.Program.Main() in C:\Documents and Settings\Pad.GEO6\Mes documents\Visual Studio 2008\Projects\TestModuleCarto\TestModuleCartto\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(Assembly 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)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Is this error came from me ?
Thanks in advance for your answer.