System.Data.Spatial.DbGeography.Intersects方法似乎总是为我返回true。我不知道为什么会发生这种情况。我创建了一个简单的命令行下面的代码片段,在以下控制台输出DbGeography相交方法不起作用
Intersects
Intersects
点显然是无处边界附近的搜索结果,因此,不应该相交。
DbGeography bounds = DbGeography.PolygonFromText("POLYGON ((146 -20,148 -20,148 -22,146 -22,146 -20))", 4326);
DbGeography point = DbGeography.PointFromText("POINT (0 0)", 4326);
if (point.Intersects(bounds) == true)
Console.WriteLine("Intersects");
else
Console.WriteLine("Does NOT intersect");
if (bounds.Intersects(point) == true)
Console.WriteLine("Intersects");
else
Console.WriteLine("Does NOT intersect");
请简化代码以显示问题。 –