本文介绍了小数纬度/经度的最大长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是最大长度(以公里或英里为单位 - 但请具体说明)纬度和经度在地球表面上可以具有的一种程度?

我是不知道我是否足够清楚,让我重述一下。众所周知,地球不是一个完美的圆圈,而赤道(或厄瓜多尔)纬度/经度的1.0的变化可能意味着一个距离,而在极点的相同变化可能意味着另一个完全不同的距离。 / p>

我试图缩小数据库返回的结果数(在本例中为MySQL),以便我可以使用公式。我不希望选择所有点,然后单独计算它们,而是选择位于经度/纬度边界内的坐标,例如:

  SELECT * FROM poi 
WHERE latitude> = 75 AND纬度< = 80
&经度> = 75;经度< = 80;

PS:现在已经很晚了,我觉得我的英语没有像我期望的那样出现,如果有什么你不明白的请说出来,我会根据需要修复/改进它,谢谢。

/ div>

纬度的长度几乎不变,在赤道约110.6公里到极点附近约111.7公里之间。如果地球是一个完美的球体,那将是不变的。为了获得已知(经纬度)10公里范围内的点数列表,假设恒定的111公里应该是正常的。



然而,它是与经度完全不同的故事。它从赤道大约111.3公里,60度纬度55.8公里,89度纬度1.9公里到极点零。

你问错了问题;您需要知道长度以确保您的查询不会拒绝有效的候选人,并且不幸的是经度的最小长度为零!



假设您采取其他民间建议,使用纬度和经度约111公里的常数。对于10公里的查询,您将使用10/111 = 0.09009度的经度或纬度余量。这在赤道是好的。然而,在北纬60度(例如斯德哥尔摩的地方),向东行驶0.09度的经度只能使您行驶5公里左右。在这种情况下您错误地拒绝了大约一半的有效答案!



幸运的是,计算获得更好的经度界限(取决于已知点的纬度)非常简单 - 请参阅和Jan Matuschek撰写的文章。


What is the maximum length (in kilometers or miles - but please specify) that one degree of latitude and longitude can have in the Earth surface?

I'm not sure if I'm being clear enough, let me rephrase that. The Earth is not a perfect circle, as we all know, and a change of 1.0 in the latitude / longitude on the equator (or in Ecuador) can mean one distance while the same change at the poles can mean another completely different distance.

I'm trying to shrink down the number of results returned by the database (in this case MySQL) so that I can calculate the distances between several points using the Great Circle formula. Instead of selecting all points and then calculating them individually I wish to select coordinates that are inside the latitude / longitude boundaries, e.g.:

SELECT * FROM poi
 WHERE latitude >= 75 AND latitude <= 80
   AND longitude >= 75 AND longitude <= 80;

PS: It's late and I feel that my English didn't came up as I expected, if there is something that you are unable to understand please say so and I'll fix/improve it as needed, thanks.

解决方案

The length of a degree of latitude varies little, between about 110.6 km at the equator to about 111.7 near the poles. If the earth were a perfect sphere, it would be constant. For purposes like getting a list of points within say 10 km of a known (lat, lon), assuming a constant 111 km should be OK.

However it's quite a different story with longitude. It ranges from about 111.3 km at the equator, 55.8 km at 60 degrees latitude, 1.9 km at 89 degrees latitude to zero at the pole.

You asked the wrong question; you need to know the MINIMUM length to ensure that your query doesn't reject valid candidates, and unfortunately the minimum length for longitude is ZERO!

Let's say you take other folk's advice to use a constant of about 111 km for both latitude and longitude. For a 10 km query, you would use a margin of 10 / 111 = 0.09009 degrees of latitude or longitude. This is OK at the equator. However at latitude 60 (about where Stockholm is, for example) travelling east by 0.09 degrees of longitude gets you only about 5 km. In this case you are incorrectly rejecting about half of the valid answers!

Fortunately the calculations to get a better longitude bound (one that depends on the latitude of the known point) is very simple -- see this SO answer, and the article by Jan Matuschek that it references.

这篇关于小数纬度/经度的最大长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 06:20