Jump to content

Calculate center location

Recommended Posts

Let's say I have a bunch of GPS locations and I want to find the GPS center of them all. Anyone have an algorithm to do this or application that just does it? I know I could use GSAK and experiment with center locations and see how far away things are, but I was hoping for something more precise. I have a whole breadth of development tools (Pascal, C#, C++, Java and PHP) at my immediate disposal, so I lots of choices.

Link to comment

By center, would you mean average or center as in something that's within the polygon created by the external points?


I'm confused as to a "GPS Center" of a shape like this:



Now you COULD take all of the coordinates and covert them to decimal degrees and average the latitudes and average the longitudes. That would give you an "average" point, but is that the "GPS Center" you're talking about?

Link to comment

If you want to do your own calculations then use the UTM coordinates for the locations rather than lattitude & longitude. One of the benefits of the UTM system is that it readily lends itself to trig calculations. Lat & long does not.


But of course all of the points of interest would have to be in the same UTM Zone. I live right on the edge of Zone 19 so half of the caches I've done are in 18 and half in 19. My workaround was to geo-average each zone then go back to Lat/Long with the 2 averages and find the weighted average of thet, I.E. 555 caches in 18 and 666 caches in 19 are something like 555/(555+666)*(lat/long) + 666/(555+666)*(lat/long) is the approximate true center of all the caches.

But that's only approximate.

One could convert ALL cache locations to x,y,z in 3 dimensions and average those and then ignore z and project the point on the Earth's surface that's above the true average. It should be close to the approximation given above.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...