I want to convert km to Latitude Longitude degrees in javascript.
I did not come across any thing as how to do that.
Any help will be much helpful.
I want to convert km to Latitude Longitude degrees in javascript.
I did not come across any thing as how to do that.
Any help will be much helpful.
If I get it correctly then you may use this formula:
1 minute of latitude North to south = 1 Nautical Mile
1 Nautical Mile = 6075 feet
1 degree = 60 Minutes
60 minutes = 60 * 6075 feet
1 meter =3.28 Feet
Hence 1 degree = 60 * 6075 / 3.28 Meters = 111,128 meters
And 1 kilometer = 1000 meters.
1 minute of Latitude = 1,852 Meters
1 degree = 60 * 1852 meters = 111.120 kilometers
So now you can do the conversions as you want.(Although degree in your question was confusing initially)
Also check Haversine formula - this states that for a great circle route the above applies. Beware that if not travelling a great circle route, degrees of latitude get closer together the further you are from the equator (the distance becomes zero at the poles).
If you want to do conversions between geographical coordinate systems and (geodesic) distances, the best approach is probably to use a third-party library, as it is an involved subject once you progress beyond the spherical earth approximation. I have used the Javascript OpenLayers mapping library to make similar calculations in the oppopsite direction (lat/Lon pairs to distances). Take a look at the appropriate parts of the documentation for guidance