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");
請簡化代碼以顯示問題。 –