开发者

Use accuracy in metres as radius for a lat-long circle?

开发者 https://www.devze.com 2023-02-21 01:58 出处:网络
I am trying to check if a set of GPS coordinates (lat-long in degrees) is matching a predefined definition of a \"smart space\". For this I will be forming a circle with the calculated GPS coordinates

I am trying to check if a set of GPS coordinates (lat-long in degrees) is matching a predefined definition of a "smart space". For this I will be forming a circle with the calculated GPS coordinates as the center and the accuracy of the GPS reading (in meters) as the radius.

Then I will be checking if any开发者_Python百科 of my list of predefined points fall inside this circle, if any point does exist inside this calculated circle then I will be assuming the current location is indeed a "smart space" for further processing.

The issue I face now is with forming this circle. While the GPS points are in degrees, the radius is in meters. I need to convert this meter distance into degrees to form my circle. Any suggestion to how I can do this? Thanks in advance.


http://en.wikipedia.org/wiki/Haversine_formula


I need to convert this meter distance into degrees to form my circle

You can't, because a degree does not correspond to any one length: the length of a degree of longitude at the equator is much longer than a degree of longitude near a pole.

Instead, find the distance from the given point to the centre of your smart space (which you imply is circular). If that is small enough, you are within the smart space.

0

精彩评论

暂无评论...
验证码 换一张
取 消