DbGeography的C#中的FromText抛出错误

时间:2017-12-08 11:39:59

标签: c# entity-framework-6

我正在使用reslut方法将Google地图地理json数据转换为System.Data.Entity.Spatial.DbGeography.FromText()数据类型,以将其保存到SQL数据库中。有时它会抛出错误

  

“24201:纬度值必须介于-90和90度之间。”

以下是我在美国绘制的多边形点及其在转换时的投掷错误:

DbGeography

即使是以下几点的投掷错误:

POLYGON(( 40.6806380252146 -106.8310546875, 40.6639728763869 -93.7353515625, 34.8318411498286 -93.27392578125, 37.9788450404971 -97.84423828125, 35.3890499669117 -98.96484375, 38.3244204270065 -100.43701171875, 35.3173663292379 -102.48046875, 38.5481654230466 -103.60107421875, 35.5143431343182 -104.9853515625, 37.7880813841205 -105.93017578125, 36.6155276313492 -111.26953125, 38.8397076135451 -107.7978515625, 38.685509760012 -111.24755859375, 40.111688665596 -108.74267578125, 38.8568201347436 -105.79833984375, 40.6806380252146 -106.8310546875))

Plolygon Image Which is throwing error

1 个答案:

答案 0 :(得分:0)

POINT(-105.542221069336 39.2369068303763)能否满足您的期望?

如果是这样的话,这些术语似乎可能与您的预期相反。