【发布时间】:2017-02-28 13:42:45
【问题描述】:
给定一个线串,如果我围绕所述线串的起点构造一个圆,我希望该圆与线串相交。
declare @startPoint geography = geography::Point(51.947859,3.986790,4326)
declare @endPoint geography = geography::Point(51.956383,3.995908,4326)
declare @g geography = geography::STGeomFromText('LINESTRING(51.947859 3.986790, 55.956383 3.995908)', 4326).MakeValid() -- The linestring
select
@startPoint.STDistance(@endPoint) -- is 1136.88182010473 metres
declare @h geography = @startPoint.STBuffer(50) -- The Circle
select
@g.STIntersection(@h).STEndPoint().Long,@g.STIntersection(@h).STStartPoint().Long
select
@g.STIntersects(@h) -- Why is this false(0)?
我需要一些帮助来理解为什么圆和线串不相交。谢谢。
【问题讨论】:
标签: sql-server tsql gis geography