DbGeography.PointFromText()为日本抛出'纬度值必须介于-90和90度之间'

hap*_*ore 18 .net geolocation

谷歌告诉我,日本的纬度/经度值是(36,138),但.NET会抛出错误

24201: Latitude values must be between -90 and 90 degrees.

有什么想法吗?

Dav*_*vid 25

我遇到了和你一样的问题,我在使用DbGeography.PointFromText("Point(lat lng)")lat&lng参数时正在使用它.完整的答案是这样的:

// From Google, Japan's latitude: 36; longitude: 138
var lat = 36;
var lng = 138;
var location = DbGeography.PointFromText($"Point({lng} {lat})");
Run Code Online (Sandbox Code Playgroud)