我的github

 

StartX和StartY 

https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/bb933917(v=sql.105)?redirectedfrom=MSDN

sql server geometry convert to x,y

https://stackoverflow.com/questions/10856014/get-x-y-values-from-point-geometry-or-geography

结果发现。。

STStartPoint和STEndPoint对于geometry来说好像不行,不过可以用STPoint代替:https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/bb933908(v=sql.105)

select Shape.STPointN(1).STX as In_X, Shape.STPointN(1).STY as In_Y, Shape.STPointN(2).STX as Out_X, Shape.STPointN(2).STY as Out_Y

from xxx_EVW  a

where geometry::STGeomFromText('POLYGON(())',4326).STIntersects(a.Shape)=1)

posted on 2021-01-18 17:06  XiaoNiuFeiTian  阅读(281)  评论(0)    收藏  举报