给定初始坐标和*小*范围计算新的 GPS 坐标

发布于 2024-09-08 21:11:59 字数 362 浏览 4 评论 0 原文

我试图弄清楚如何计算 GPS 坐标的特定给定范围内的最小/最大纬度/经度界限。

例如: gps 坐标 37.42935699924869,-122.16962099075317 范围 0.2 英里

我正在查看 http://www.movable-type.co.uk/scripts/latlong.html 网站,但我不确定这是否正是我想要的。

这给出了 4 个独特的纬度/经度对,我想要/需要一个最大/最小纬度和一个最大/最小长度。

I'm trying to figure out how to calculate a min/max lat/long bound on the specific given range of a gps coordinate.

for example: gps coord 37.42935699924869,-122.16962099075317 range .2 miles

I'm looking at the point + range + bearing in the http://www.movable-type.co.uk/scripts/latlong.html site but im not sure if this is exactly what i want.

This gives 4 unique lat/long pairs and I want/need a max/min lat and a max/min long.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

忱杏 2024-09-15 21:11:59
  1. 计算(恒定)中心点和要测试的点之间的距离。 (此页面应该为您提供距离(以米为单位) )。
  2. 如果(距离<0.2)那么......

好吧,给定一个点和一个距离,你会得到一个圆。

您正在寻找两个点,它们本质上描述了一个正方形(两个相对的角)。您要寻找的两个点甚至不在圆上。我不太清楚你为什么想要这个,但我认为你的问题没有答案。

也许您可以告诉我们您想要实现什么目标。

编辑:添加图像来说明。橙色线是距中心的距离(例如 0.2 英里)

alt text http:// img155.imageshack.us/img155/1315/diagramp.png

  1. Calculate the distance between the (constant) central point and the point you want to test. (This page should give you the distance (in meters)).
  2. If (distance < 0.2) then ...

Well, given a point and a distance, you will get a circle.

You're looking for two points, which will essentially describe a square (two opposite corners). The two points you're looking for won't even be on the circle. I'm not exactly sure why you want this, but I don't think there is an answer to your question.

Perhaps you could tell us what you're trying to accomplish.

EDIT: Added image to illustrate. The orange line is the distance from the centre (e.g. 0.2 miles)

alt text http://img155.imageshack.us/img155/1315/diagramp.png

遗心遗梦遗幸福 2024-09-15 21:11:59

在您澄清之后,这是一个不太优雅的答案,可能会给您带来您想要的东西。好吧,你想要一个非常复杂的函数的反函数。恐怕我的数学能力无法胜任这项任务,但它应该是可行的。

一个不太优雅的解决方案是通过反复试验来找到它。本质上,保持经度相同并改变纬度。使用正确的算法,您应该能够找到一个非常接近您想要的距离的算法。这将为您提供圆上的一个点(也在正方形上的四个点之一)。

然后保持纬度相同并改变经度。这将为您提供正方形上的第二个点(在一侧的中间),从那里您可以找到正方形的 4 个角。

这会减慢速度,具体取决于您需要执行此操作的频率,这可能重要也可能无关紧要。

After your clarification, here is a less elegant answer that might give you what you want. Well, you want the inverse of a really complicated function. I'm afraid my math skills aren't up to the task, but it should be doable.

A less elegant solution is to find it by trial and error. Essentially, keep longitude the same and vary latitude. Using the right algorithm, you should be able to find one that is very close to the distance you want. This will give you a point on the circle (one of four that is also on the square).

Then keep latitude the same and vary longitude. This will give you a second point on the square (on the middle of one of the sides), from there you can find the 4 corners of the square.

This will slow, depending on how often you have to do it, that might or might not matter.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文