How do I find the center of a number of geographic

2019-03-18 03:31发布

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

7条回答
手持菜刀,她持情操
2楼-- · 2019-03-18 03:50

Geomidpoint covers 3 different methods for calculating this.

查看更多
Anthone
3楼-- · 2019-03-18 03:56

Several people have answered to take the mean of the latitudes and longitudes. This is sort of the right idea, but means are more complicated on the sphere.

The latitude/longitude representation is essentially artificial and has discontinuities (at the poles, and opposite the prime meridian if you aren't careful), so it taking means in it doesn't seem likely (to me) to have a sensible geometric interpretation. I think you need to do something like averaging vectors in earth-centered coordinates, and then normalizing the result to put it back on the sphere.

I hope someone with more experience in these matters can comment more concretely.

查看更多
Deceive 欺骗
4楼-- · 2019-03-18 03:57

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.

查看更多
贪生不怕死
5楼-- · 2019-03-18 03:59

Don't just take averages.

You can convert to 3d coordinates, then take the average (of x,y, and z coords), then project it back onto the sphere and turn that back into lat/long.

The wikipedia page on spherical coordinates has conversion algorithms.

查看更多
倾城 Initia
6楼-- · 2019-03-18 04:04

You're probably looking for the centroid of the simple polygon defined by the points. There is information on how to calculate it for various geometries in that article.

查看更多
forever°为你锁心
7楼-- · 2019-03-18 04:05

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.

查看更多
登录 后发表回答