2

那有什么问题?

const string lonMin="-19";      
const string latMin = "25";
const string lonMax = "-24";
const string latMax = "25.6";

//Create a polygon
var geoEncuadre = DbGeography.FromText("POLYGON ((" + lonMin + " " + latMin + "," +
            lonMax + " " + latMin + ","+ lonMax + " "+ latMax +","+lonMin+" " + latMax +","+lonMin + " "+latMin +  "))", 4326);
//Check for every node if intersects with the polygon
var nodos = (from n in _bd.Nodo
             where n.Geo.Intersects(geoEncuadre)
             select n).ToList();

这会抛出一个EntityCommandExecutionException. 这很奇怪,因为如果我使用DbGeometry而不是DbGeography它可以正常工作。DbGeographyIntersect操作会发生什么?

4

0 回答 0