您好,我在 SQL Server 中有以下代码,为什么如果我想计算 @geog 的 sTArea 失败而 @geom 成功?,如何将此多边形从几何数据类型转换为地理数据类型以获得 STArea?,谢谢你。
DECLARE @geom geometry;
SET @geom = geometry::STGeomFromText('POLYGON ((-99.213546752929688 19.448402404785156, -99.2157974243164 19.449802398681641, -99.2127456665039 19.450002670288086, -99.213546752929688 19.448402404785156))', 4326);
select @geom.STArea();
DECLARE @geog geography;
SET @geog = geography::STGeomFromText('POLYGON ((-99.213546752929688 19.448402404785156, -99.2157974243164 19.449802398681641, -99.2127456665039 19.450002670288086, -99.213546752929688 19.448402404785156))', 4326);
select @geog.STArea();