Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 354
dvorak Avatar asked Sep 24 '08 16:09

dvorak


People also ask

How do you find the center point of multiple locations?

Add the latitudes of each, divide by 3. Add the longitudes of each, divide by 3. The result is the lat and long of the mid point, enter it in google maps.

What is the geographical central point?

In geography, the centroid of the two-dimensional shape of a region of the Earth's surface (projected radially to sea level or onto a geoid surface) is known as its geographic centre or geographical centre or (less commonly) gravitational centre.


3 Answers

Geomidpoint covers 3 different methods for calculating this.

like image 164
dvorak Avatar answered Oct 06 '22 17:10

dvorak


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.

like image 25
Doug McClean Avatar answered Oct 06 '22 17:10

Doug McClean


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.

like image 26
Tyler Avatar answered Oct 06 '22 15:10

Tyler