0

こんにちは、北西の緯度と経度、南東の緯度と経度の地理エリアを作成しようとしていますが、これらの座標でクエリを実行すると、この例外が発生します。

Select (geography::STGeomFromText('POLYGON((-0.534717 0.524190,0.426951 0.524190,0.426951 -0.578706,-0.534717 -0.578706,-0.534717 0.524190))', 4326))

A .NET Framework error occurred during execution of user-defined routine or aggregate "geography": 
Microsoft.SqlServer.Types.GLArgumentException: 24205: The specified input does not represent a valid geography instance because it exceeds a single hemisphere. Each geography instance must fit inside a single hemisphere. A common reason for this error is that a polygon has the wrong ring orientation. To create a larger than hemisphere geography instance, upgrade the version of SQL Server and change the database compatibility level to at least 110.
Microsoft.SqlServer.Types.GLArgumentException: 
   at Microsoft.SqlServer.Types.GLNativeMethods.GeodeticIsValid(GeoData& g, Double eccentricity, Boolean forceKatmai)
   at Microsoft.SqlServer.Types.SqlGeography.IsValidExpensive(Boolean forceKatmai)
   at Microsoft.SqlServer.Types.SqlGeography..ctor(GeoData g, Int32 srid)
   at Microsoft.SqlServer.Types.SqlGeography.GeographyFromText(OpenGisType type, SqlChars taggedText, Int32 srid)
.
4

1 に答える 1

1

リングの向きが正しくないため、ポリゴンは「裏返し」になっています。代わりにこれを使用する必要があります。

SELECT geography::STGeomFromText('POLYGON ((0.426951 0.52419, -0.534717 0.52419, -0.534717 -0.578706, 0.426951 -0.578706, 0.426951 0.52419))', 4326);
于 2012-08-15T14:20:13.410 に答える