我真的不知道该怎么办。。
DECLARE @g geography = geography::STGeomFromText('POLYGON((1 1, 3 1, 3 3, 1 3, 1 1))',4326)
DECLARE @g2 geography =geography::STGeomFromText( 'POLYGON((0 0, 2 0, 2 2, 0 2, 0 0))',4326)
Declare @union geography = @g2.STUnion(@g)
Declare @diff geography = @g2.STDifference(@g)
SELECT @g.STArea() + @g2.STArea() - @union.STArea()
SELECT @union.STArea()+@diff.STArea()
ret: "12306061878,1564" "123060620496,501" 找出 5 个不同点...
额外的:
select @union.ToString()
ret
POLYGON ((0 2, 0 0, 2 0, 2.0000000000000591 1.0001522971041397, 3 1, 3 3, 1 3, 1.0000000000000655 2.0003044086154023, 0 2))