Interpolating GPS coordinates

8.1k Views Asked by At

I can't profess to being a hardcore mathematician, I'm a computer scientist by nature, so please take it easy on me! There are a couple of similar questions on this, however, none seem to discuss the matter when we want to assume the earth is spherical.

I've got two lattitude/longitude points that are any distance upto ~100km apart. I need to add additional points roughly every 100m (which will be automated once I understand the maths).

I can hapily find the midpoint (where my mathematical knowledge runs out), however in data processing terms this is too processor intesive (to find the midpoint several times), so is there a formula that someone can derive/recite that will calculate a point on the curve between two GPS points that is a set distance away (say 100m)?

Thanks for your help.

1

There are 1 best solutions below

1
On

The simplest is to interpolate linearly in angle. If you have points $(a,b)$ and $(c,d)$ and want $n$ intervals (so $n-1$) intervening points), your points are $(a+\frac in(c-a),b+\frac in(d-b))$ for $i=1,2,3\dots n-1$ This will not follow a great circle, nor be exactly evenly spaced, but will be smooth and involves not a single trig call. The errors in the interpolation decrease as the step length gets shorter. $100$ km is only $\frac 1{64}$ radius, so that is pretty small.

Alternately, you can do the midpoint calculation a few times, then do linear interpolation. That gets you shorter steps at the price of more computation