19

If I have a series of points as longitude and latitude, how would I calculate the center of all of those points?

4

7 回答 7

11

Geomidpoint涵盖了 3 种不同的计算方法。

于 2008-09-24T17:42:12.997 回答
7

有几个人回答要取经纬度的平均值。这是一种正确的想法,但在 sphere 上的手段更加复杂

纬度/经度表示本质上是人为的并且有不连续性(在两极,如果你不小心的话,在本初子午线对面),所以它似乎不太可能(对我来说)有一个合理的几何解释. 我认为你需要做一些事情,比如在地心坐标中平均矢量,然后对结果进行归一化以将其放回球体上。

我希望在这些问题上有更多经验的人可以更具体地发表评论。

于 2008-09-24T17:24:54.643 回答
5

不要只取平均值。

您可以转换为 3d 坐标,然后取平均值(x、y 和 z 坐标),然后将其投影回球体并将其转换回纬度/经度。

关于球坐标的维基百科页面有转换算法。

于 2008-09-24T18:37:18.120 回答
4

First off, you need to define which centre you're interested in. Take these two points:

A.                          .B

The centre is easy, it's halfway between them. Now add a third point:

A. C.                       .B

Is the centre still halfway between A and B or is it weighted towards A because of C? So is the centre the point nearest to all points or just the points on the enclosing polygon?

Also, as it's long/lat you're dealing with the points are on a surface of a sphere so the distance between long 0 and long 90 degrees is much greater at lat 0 than at lat 45 degrees.

于 2008-09-24T17:03:12.933 回答
1

您可能正在寻找由点定义的简单多边形的质心。该文章中有关于如何计算各种几何形状的信息。

于 2008-09-24T17:04:09.937 回答
0

如果您以下列形式提出问题,Wolfram Alpha 将为您执行此操作: 具有顶点的多边形的质心:(X, Y), (X, Y), (X, Y), (X, Y), (X, Y) 等。

只需记住先将每个“(X,Y)”转换为十进制形式。Wolfram Alpha 将以十进制形式返回答案,然后您可以将其复制并粘贴到 Google 地球中。

于 2014-10-24T20:31:42.793 回答
-1

See Moe's answer, although if your points are distributed across the globe, you'll have to be satisfied that your center tends towards the Prime Meridian and not the International Date Line.

于 2008-09-24T16:59:25.580 回答