0
我有一个问题在SQL Server 2012中当我试图让两个多边形的交集:SQL Server的地理多边形交集
DECLARE @boundingRect geography;
SET @boundingRect = N'POLYGON((27 30, 170 30, 170 80, 27 80, 27 30))'
DECLARE @boundingRect2 geography;
SET @boundingRect2 = N'POLYGON((84 56, 84.1 56, 84.1 56.1, 84 56.1, 84 56))'
SELECT @boundingRect.STIntersection(@boundingRect2).ToString()
返回GEOMETRYCOLLECTION EMPTY
。但它必须返回第二个多边形,因为@boundingRect
包含@boundingRect2
。如果我更改为
SET @boundingRect = N'POLYGON((27 20, 170 20, 170 80, 27 80, 27 20))'
它工作正常。为什么?我究竟做错了什么?