这是不可能的。我通过在 C# 中创建 WKT 多边形字符串表示来解决了这个问题。
等式总结如下:
var step = 2*Math.PI/40; // creates 40 points (1 for each "step")
var radians = 5.868;
var semiMajMetres = 400;
var semiMinMetres = 200;
var latMetres = latVal*110575; // converts degree value to metres value
var lonMetres = lonVal*111303; // assumes you have variables with these known values
for(double theta = 0; theta <= 2 * Math.PI; theta += step)
{
var lon = lonMetres + semiMajMetres * Math.Cos(theta) * Math.Cos(radians) - semiMinMetres * Math.Sin(theta) * Math.Sin(radians);
var lat = latMetres + semiMajMetres * Math.Cos(theta) * Math.Sin(radians) + semiMinMetres * Math.Sin(theta) * Math.Cos(radians);
lat /= 110575; // convert metres back to degrees
lon /= 111303;
// Create your POLYGON string with these values in format POLYGON((lon lat, lon lat, lon lat, lon lat))
// Note that the last coordinate set MUST be identical to the first coordinate set - confirm this and rectify the last coordinate double precision, if required
}
现在创建地理对象:
DECLARE @g geography;
SET @g = geography::STPolyFromText('POLYGON(([lonValue] [latValue], POINT([lonValue] [latValue], POINT([lonValue] [latValue], POINT([lonValue] [latValue]))', 4326);
SELECT @g;