地理位置边界圆 [英] Geo Locations Bounding Circle

查看:110
本文介绍了地理位置边界圆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





假设我有两个地点,分别为A和B.



我将使用边界圆公式得到两个点的(MinLat,MaxLat,MinLon,MaxLon)。



现在考虑我们正在绘制从A点到B点的路线。



我知道有很多实现计算给定Lat / Lon对的边界圆,但我想做的是计算介于两者之间的所有点来自A和B周围的圆的路径。



示例图:O ==== O想要找到这些相等点之间和之内的点。



有没有人对此有任何想法?我正在使用MapQuest及其托管数据库,但我的老板希望我使用计算公式。



首先我关注的是哪个方向(任何想法都赞赏)。其次,这样的手动公式会有性能问题吗?如果在代码而不是SQL存储过程中运行?



感谢您的任何建议或建议。

Hi,

Lets say I have two locations, point A and B.

I would use a bounding circle formula to get (MinLat, MaxLat, MinLon, MaxLon) for both points.

Now consider we are plotting a route from point A to point B.

I know that there are many implementations for calculating a bounding circle for a given Lat/Lon pair, but what I want to do is Calculate all points that lie between path from circle surrounding A and B.

Example Figure: O====O Wanna find point between and inside those equal points.

Does anyone have any ideas about this? I'm using MapQuest and their hosted databases, but my boss wants for me to use Calculated formulae.

First I'm concerned with which direction to proceed in (any ideas appreciated). Second, would such manual formulae have performance issues? if run in code instead of SQL stored procedures?

Thanks for any suggestions or advice.

推荐答案

假设您的兴趣点数据正确存储在SQL数据库中(即纬度和经度在带索引的单独数字列中),我建议两个步骤:

- 使用SQL查询,过滤对于那些具有MinLat< = latitude< = MaxLat AND MinLon< = longitude< = MaxLon

- 在C#代码中的POI,通过生成的候选者迭代并计算给定两个点的边界圆加上候选者:如果边界圆的中心保持不变,则候选者位于该圆内。 (由于四舍五入问题,您可能需要允许对中心进行微小更改。)

这不是一个快速的方法,但至少是一个起点。
Assuming that your data of Points of Interest are stored in a SQL database properly (i.e. latitude and longitude in separate numeric columns with indices), I'd suggest two steps:
- using a SQL query, filter for those POIs with MinLat<=latitude<=MaxLat AND MinLon<=longitude<=MaxLon
- in C# code, iterate thru the resulting candidates and calculate the bounding circle for your given two points plus the candidate: if the center of the bounding circle stays unchanged, the candidate is inside that circle. (You may need to allow for minor changes of the center due to rounding issues).
That's not a fast approach, but at least a start point.


这篇关于地理位置边界圆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆