System.FormatException:24201:纬度值必须介于-90和90度之间

时间:2013-06-11 11:55:42

标签: google-maps-api-3 sql-server-2012-express

我正在使用Google maps API开发asp.net MVC4应用程序。

我使用sql geography数据类型在地图上存储Point,polygon或折线。

问题是当我使用多边形或折线绘制小区域地图时,它工作正常并保存在DB中。

但是当我绘制大区域时,从sql server端发生以下错误。

有人知道为什么会这样吗?

A .NET Framework error occurred during execution of user-defined routine or aggregate "geography": 
System.FormatException: 24201: Latitude values must be between -90 and 90 degrees.
System.FormatException: 
   at Microsoft.SqlServer.Types.GeographyValidator.ValidatePoint(Double x, Double y, Nullable`1 z, Nullable`1 m)
   at Microsoft.SqlServer.Types.Validator.AddLine(Double x, Double y, Nullable`1 z, Nullable`1 m)
   at Microsoft.SqlServer.Types.ForwardingGeoDataSink.AddLine(Double x, Double y, Nullable`1 z, Nullable`1 m)
   at Microsoft.SqlServer.Types.CoordinateReversingGeoDataSink.AddLine(Double x, Double y, Nullable`1 z, Nullable`1 m)
   at Microsoft.SqlServer.Types.WellKnownTextReader.ParseLineStringText()
   at Microsoft.SqlServer.Types.WellKnownTextReader.ParsePolygonText()
   at Microsoft.SqlServer.Types.WellKnownTextReader.ParseTaggedText(OpenGisType type)
   at Microsoft.SqlServer.Types.WellKnownTextReader.Read(OpenGisType type, Int32 srid)
   at Microsoft.SqlServer.Types.SqlGeography.ParseText(OpenGisType type, SqlChars taggedText, Int32 srid)
   at Microsoft.SqlServer.Types.SqlGeography.GeographyFromText(OpenGisType type, SqlChars taggedText, Int32 srid)

1 个答案:

答案 0 :(得分:1)

94.39453125大于90。

29.84064389983441 94.39453125

来自您的POLYGON:

 'POLYGON((29.22889003019423 71.279296875,16.720385051694 78.75,29.84064389983441 94.39453125,29.22889003019423 71.279296875))'