SQL Server 2008 Geography .STBuffer() distance measurement units

心不动则不痛 提交于 2019-12-10 03:07:05

问题


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(x y)', 4326).STBuffer(z).STIntersects(geography::STGeomFromText('POINT(' + CAST(v.Longitude as varchar(max)) + ' ' + CAST(v.Latitude as varchar(max)) + ')', 4326)) = 1


回答1:


STBuffer is in meters. More info here.

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

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




回答2:


The unit of measurement depends on the spatial reference system in use. See this system view for details:

SELECT * FROM sys.spatial_reference_systems;



来源:https://stackoverflow.com/questions/2971293/sql-server-2008-geography-stbuffer-distance-measurement-units

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!