DbGeography.Distance 返回了错误的结果

DbGeography.Distance returned incorrect result

这是我的简化代码:

var P1 = Common.Geography.CreatePoint((decimal)-73.980000, (decimal)40.7155773);
var P2 = Common.Geography.CreatePoint((decimal)-73.984434, (decimal)40.7155773);
var Distance = P1.Distance(P2);

这里是"CreatePoint"函数:

public static DbGeography CreatePoint(decimal Longitude, decimal Latitude)
{
    return DbGeography.FromText(String.Format(CultureInfo.InvariantCulture, "POINT({0} {1})", Longitude, Latitude));
}

我在几个来源中看到结果应该以米为单位,所以我希望看到 493:

http://boulter.com/gps/distance/?from=-73.98%2C40.7155773&to=-73.984434%2C40.7155773&units=k

Google 地图测量工具显示相同的结果(但不允许共享 link)。

但是我从 "Distance" 函数得到的结果是 374.65。我检查了两个对象的 CoordinateSystemId,它的默认值是 4326。

那么我做错了什么?或者该结果的单位是什么?

检查纬度/经度顺序是否在某处调换。

如果我在你的抱石中交换顺序,我得到 0.37k link: http://boulter.com/gps/distance/?from=40.7155773%2C-73.98&to=40.7155773%2C-73.984434&units=k 这可能就是您在 C# 代码中得到的内容。

请注意,博尔特和 google 地图的顺序应为 latitude, longitude; WKT 使用相反的顺序 longitude, latitude