-3

How do i convert a given distance (in metres) into geographic coordinates.

What I need is to draw a polygon on the map (a regular polygon, like a circle), however, it's radius is given in meters, how do I calculate the radius in degrees or radians?

I'll probally code it in c

Wanderson Silva
  • 1,159
  • 1
  • 13
  • 33
  • 1
    Your question is wrong. A circle is not a polygon, and you can't measure the radius (a unit of linear distance) in degrees or radians (a unit of rotation). The title of your question is also nonsensical. – Kirk Broadhurst Nov 02 '11 at 04:01
  • 2
    I don't know what they're teaching now, but 55 years or so ago I was taught that a circle is a polygon with an infite number of sides. – Terry Nov 02 '11 at 06:27
  • Meant to say infinite number of sides. I take his question to be that given a point on a lat/long map and with a circle drawn to the scale of the map such that its radius is, say, 1000 meters, is it possible to find the lat/long of any point on the circumference of that circle, and it is. – Terry Nov 02 '11 at 06:36
  • Can you please edit to make this programming related? Otherwise, this will be closed as off topic or possibly migrated to [gis.se]. –  Nov 02 '11 at 16:19
  • Well, the thing is I am considering a regular polygon with a great number of sides as a circle. Anyway, I have a distance in meters to be the radius of a circle around a lat/lon point. – Wanderson Silva Nov 03 '11 at 04:02

3 Answers3

1

Well, consider that at the equator (0 degrees latitude) one degree of longitude is equal to appximately 60 nautical miles. At either pole (90 degrees latitude) a single degree of longitude equals 0 nautical miles. As I remember the cosine of the latitude times 60 will give you the approximate distance in nautical miles at that latitude of a single degree of longitude.

However, how accurate you would be would have to account for the map projection you're using. For aeronautical maps, they use the Lambert Conformal Conic projection, which means distances are only exactly accurate along the two latitudes that the cone cuts the sphere of the earth. But if an approximation is good enough, you may not need the accuracy.

For conversion, one nautical mile equals 1.852 km. If I did the arithmetic properly (no guarantee, I'm in my 70s), that means that a meter equals (except as you get really close to the poles) 0.0000009 degrees latitude. It also equals 0.0000009 degrees longitude on the equator. If you're not at the equator, divide the 0.0000009 by the cosine of the latitude to get the degrees of longitude.

So, a 1000 meter radius circle at 45 degrees latitude would mean a radius of 0.0009 degrees latitude and 0.0009/0.707 degrees longitude. Approximately of course.

All this is from memory, so take it with a grain of salt. If you really want to get involved, Google geographic equations or some such.

Terry
  • 1,389
  • 2
  • 11
  • 25
1

Oh man, geographic coordinates can be a pain in the behind. First of all, I'm assuming that by geographic coordinates, you're talking about geodetic coordinates (lat/lon).

Second of all, you can't find a "radius" in radians or degrees. Why, you ask? Well, one degree of longitude at the equator is WAY longer than one degree of longitude close to the north or south pole. The arc of one degree latitude also changes based on your location on the earth since the earth is not a perfect sphere. It's usually modeled as an ellipsoid.

That being said, here are two ways to map the coordinates of a polygon onto lat-lon coordinates:

1) If you're feeling like a complete badass, you can do the math in lat-lon. Lots of trig, easy to make mistakes... DON'T DO IT. I'm just including this option here to let you know that it is possible.

2) Convert your geodetic coordinates to UTM. Then, you can do whatever you need to do in meters (i.e. find the vertices of a polygon), and then convert the resulting UTM back to geodetic. Personally, I think this is the way to go.

aleph_null
  • 5,708
  • 2
  • 22
  • 37
0

Check out http://trac.osgeo.org/proj/wiki/GeodesicCalculations. Depending on the accuracy you need, this can get pretty complicated, so you're probably best off starting from some existing code.

user57368
  • 5,580
  • 26
  • 38