SQL Server 2008地理.STBuffer()距离测量单位

编程入门 行业动态 更新时间:2024-10-23 09:22:46
本文介绍了SQL Server 2008地理.STBuffer()距离测量单位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用经/纬度来处理地理点,因此需要在我们数据库的半径5英里范围内找到其他点.但是,我似乎找不到STBuffer的单位",它似乎不符合英尺,英里,米,公里等.文档仅将它们称为单位",有任何建议?谢谢

I'm working with a geographic point using lat/long and need to find other points in our database within a 5 mile radius of that point. However, I can't seem to find out what the "units" are for STBuffer, it doesn't seem to conform to feet, miles, meters, kilometers, etc. The documentation only refers to them as "units", any suggestions? Thanks

[...] from geography :: STGeomFromText('POINT(xy)',4326).STBuffer(z).STIntersects(geography :: STGeomFromText('POINT('+ CAST(v.Longitude as varchar(max)))+''+ CAST(v.Latitude as varchar(max))+')',4326))= 1

[...] from geography::STGeomFromText('POINT(x y)', 4326).STBuffer(z).STIntersects(geography::STGeomFromText('POINT(' + CAST(v.Longitude as varchar(max)) + ' ' + CAST(v.Latitude as varchar(max)) + ')', 4326)) = 1

推荐答案

STBuffer以米为单位.此处有更多信息.

STBuffer is in meters. More info here.

要将英里转换为米,请将英里数除以0.0006213712

To convert, miles to meters, divide the number of miles by 0.0006213712

(即5英里/0.0006213712 = 8,046.72米)

(i.e. 5 miles / 0.0006213712 = 8,046.72 meters)

更多推荐

SQL Server 2008地理.STBuffer()距离测量单位

本文发布于:2023-10-13 10:22:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1487689.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:测量   地理   距离   单位   Server

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!