简体   繁体   English

如何找到当前点纬度和纬度附近的区域

[英]How to find area around my current point lat and long

I have a point with latitude and longitude as (current place). 我有一个经度和纬度为(当前地点)的点。 In my Database, I have many points (lat & long) which show me stores (for example). 在我的数据库中,我有很多点(经纬度),可以显示商店(例如)。 I need a SQL Server query to get stores which are near my current place with 5 Kilometers distance. 我需要一个SQL Server查询来获取距离我当前位置最近的商店(5公里的距离)。

使用STDistance方法:

SELECT * FROM dbo.MyTable WHERE Location.STDistance(@CurrentPlace) <= 5000;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM