Welcome to MapForums!

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

## Conversion from geographic degrees to metres

This is a discussion on Conversion from geographic degrees to metres within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi! I met a problem when programming with Mappoint 2000 and Visual Basic 6. Having a position defined by latitude ...

1. Senior Member Black Belt
Join Date
Jul 2002
Posts
5,137

## Conversion from geographic degrees to metres

Hi!

I met a problem when programming with Mappoint 2000 and Visual Basic 6. Having a position defined by latitude and longitude degrees (either decimal or in hours, minutes and seconds), I can establish a radio in metres (using a Radius object). I need to know whether another point, also given in latitude and longitude degrees, is within the area defined by the first point and the radio. But, for that I have to convert from degrees to metres or vice versa.

IŽve been searching for information on the net and many pages ask for several parameters such as ellipsoid, projection and prime meridian. Is there any library or whatever already coded I can use that doesnŽt need so many things? Or, if all of these is necessary, a way to find which parameters I will need and a function to use it within Visual Basic or Mappoint? Do you know any way to find if the second point is within that area avoiding conversion?

2. Sounds like you're finding the right formula (some are over-simplified).

You need to take into account the geoid that your coordinates are on.
Coming from a geophysical background I could bore you to death as to what a geoid really is, but in this case you need to know that the shape of the Earth is approximated with an ellipsoid. To get an accurate distance, you need to use the correct ellipsoid that your coordinates are on.

MapPoint (and most GPS systems) use an ellipsoid known as "WGS84", because this is a pretty good approximation worldwide
(some countries use other ellipsoids, because they are a better fit locally).

So you need to search the web for the WGS84 ellipsoid specification, and plug these into your calculations that you've found. I would use double precision floating point for the calculations - yes all those digits in the ellipsoid spec do matter!!

Eric: Is there an article here, that does this?

What I could really do with, is a book with all this stuff - a "cookbook" of useful mapping calculations" as it were, along with useful reference information such as common ellipsoid calculations.
Most of it is out there on the web, but it would be useful in one place.

Richard

3. I recently coded a quickie distance test for a project in VBA that uses the great distance formula from the Aviation Formulary..
http://williams.best.vwh.net/avform.htm

I hacked at the Excel spreadsheet found on that page to come up with my functions.
http://williams.best.vwh.net/ftp/avsig/avform.xls

You can also take a look at this:
http://www.mp2kmag.com/a73--geodesy.....mappoint.html

Eric

4. Senior Member Black Belt
Join Date
Jul 2002
Posts
5,137

## Conversion from geographic degrees to metres

Nice to know I found the right formula, although they are hard to understand and specially to use.

IŽll go through your code, Eric, to come up against my conversion problem. It may be what I am looking for.

IŽll tell you how I am doing.

5. Senior Member Black Belt
Join Date
Jul 2002
Posts
5,137

## Conversion from geographic degrees to metres

I finally found a quicker way to obtain the conversion. Gilles Kohl told me about the DistanceTo method of a Location object. And that really works.

Thanks!

6. Ah Good!

The reason I didn't want to use it in my project was because I needed to iteratively calculate the distance hundreds of times until a test condition was met, so I didn't want the overhead of calling MapPoint. For some reason I was thinking you were in the same boat.

Eric

7. Senior Member Black Belt
Join Date
Jul 2002
Posts
5,137

## Conversion from geographic degrees to metres

ThatŽs a good consideration, IŽll take it into account. In my program I just need to calculate it once, so I hope I wonŽt be in that situation.

Thanks again!