# GPS Matrix

1. ## GPS Matrix

Hi all !

I'm trying to link 2000 GPS points (with lat and long coordinates in decimals) to a list of 200 cities (that also have lat and long coordinates in decimals) by choosing the closest city.
I guess I have to build some kind of double matrix and where I calculate the differences between the latitude of the first point and all the latitudes of my city list, and choose the smallest differences. But in the same I have to do the same with longitudes...that's where it gets trickier...Should I build some kind of vector that calculates the absolute distance? How could I do that?

Is it clear? Any ideas ?

Because of confidentiality, I cannot give the coordinates (but it is for a good cause :-))

Pierre

2. ## Re: GPS Matrix

Hi Pierre,

You need the smallest differences between the - let say coordinates. I believe it would be better if you use a example to describe only this point and get this transferred to your own scenario.

Regards,
DILIPandey

<click on below 'star' if this helps>

3. ## Re: GPS Matrix

Actually your comment made me realise that the distance is not simply the difference between coordinates because 1 degree in Latitude is different than I deg in Longitude.
So a friend gave the formula and I got to that result (in attached).
No need for macro, matrix...what do you think, does it look correct ?

4. ## Re: GPS Matrix

Hi pierre,

You are looking for the min. distance in A to J and the formula in AH column is doing the same. so it looks correct to me.

Regards,
DILIPandey

<click on below 'star' if this helps>

There are currently 1 users browsing this thread. (0 members and 1 guests)