我有两个几何,当我尝试从这两个几何中获取STIntersection时,sql server返回Exception的输出。
Msg 6522, Level 16, State 1, Line 6
A .NET Framework error occurred during execution of user-defined routine or aggregate "geometry":
System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
System.Runtime.InteropServices.COMException:
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.SqlServer.Types.GLNativeMethods.Combine(CombineMode combineMode, GeoData g1, GeoData g2)
at Microsoft.SqlServer.Types.SqlGeometry.STIntersection(SqlGeometry other).
我正在尝试对两个多边形进行STIntersection,其中一个多数来自STNumPoints有51536个点,另一个有3125个。
我用这个选择尝试了它:
declare @geomHnv geometry = ( select top 1 Shape from dbo.hnv)
declare @geomSaps geometry = ( select top 1 Shape from dbo.Saps)
select @geomSaps.STNumPoints()
select o1.Shape.STIntersection(o2.Shape)
from dbo.hnv o1
cross join dbo.saps o2
多边形太大了,我无法在这里复制它,所以我只用上面的两个多边形来备份数据库。
链接:https://drive.google.com/open?id=0B8Vv9ogG99P-YmZSNkFDLUpZb3M
转储由两个表组成,每个表包含一个几何列。
我在SQL Server 2014上尝试过它。