How do I find the center of a number of geographic points?
Asked Answered
O

7

20

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

Obsequious answered 24/9, 2008 at 16:56 Comment(0)
O
11

Geomidpoint covers 3 different methods for calculating this.

Obsequious answered 24/9, 2008 at 17:42 Comment(0)
H
7

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.

Houseclean answered 24/9, 2008 at 17:24 Comment(0)
S
5

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.

Substage answered 24/9, 2008 at 18:37 Comment(0)
S
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.

Showmanship answered 24/9, 2008 at 17:3 Comment(2)
I think it would be to c, since it would be providing some weighting.Obsequious
This is a good question, but it's not really an answer.Balkan
A
1

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.

Arvonio answered 24/9, 2008 at 17:4 Comment(5)
A centroid is the center of a region or shape, not the center of a number of distinct pointsKourtneykovac
A number of distinct points defines a shape, so we are dealing with a shape whether we call it that or not.Arvonio
A number of distinct points could define a large number of different shapes, depending on how you connect them. Also, I don't see anything on the wikipedia article about spherical coordinate systems.Obsequious
Exactly! If there is no specific way to define a shape, then there is not specific way to define its center. If you want to find the center, you have to decide how to define the shape first.Kourtneykovac
The way to define the shape is to connect the points in either clockwise or counter-clockwise order; it does not matter. However, you're correct that I should have been more specific in specifying a simple polygon instead of a generic shape.Arvonio
S
-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.

Sideslip answered 24/9, 2008 at 16:59 Comment(0)
A
-1

Wolfram Alpha will do this for you if you ask the question in the following form: centroid of polygon with vertices: (X, Y), (X, Y), (X, Y), (X, Y), (X, Y), etc.

Just remember to convert each "(X, Y)" into decimal form first. Wolfram Alpha will return the answer in decimal form, which you can then copy and paste into Google Earth.

Abernathy answered 24/10, 2014 at 20:31 Comment(1)
This won't be appropriate for spherical calculations, for instance if the points evenly straddle a small area on the international date line (so, positive & negative longitude values), this will give a point on the opposite side of the earth near the prime meridian.Wait

© 2022 - 2024 — McMap. All rights reserved.