Converting degrees/min/secs coordinates to different format?

vftt.org

Help Support vftt.org:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Peakbagr

Well-known member
VFTT Supporter
Joined
Sep 3, 2003
Messages
3,872
Reaction score
288
Location
Near the Adirondack Blue Line
I'm trying to locate trailless and in many cases, unnamed peaks on a computer map.

I have a list that I'm working on and the coordinate are
expressed this way: 43°32'53" x 74°35'00".
I'd like an easy way to convert them to this format: N43.63313 W74.57810

A friend suggested posting it on a GPS board but I thought that there's enough expertise on VFTT that I wouldn't have to join another board to find a solution I can understand.

Thanks for anyone who can assist with this project.

PB
 
The first format is degrees-minutes-seconds, the second is decimal degrees. North/south is always listed before east/west. If you're talking about a location in New England, you're talking North (of the equator) and West (of Greenwich); some computerized systems will want you to enter the West coordinate as a negative number; it's not really correct to leave off the "N" or "W" otherwise.

All you need to know is that there are 60 minutes in a degree, and 60 seconds in a minute. A bit of long division, and you're done.

Optimizing the algorithm is left as an exercise for the reader.

(If you're truly lazy, go to an online map that accepts coordinates in either format, and have then have it display in the other...)
 
I'm trying to locate trailless and in many cases, unnamed peaks on a computer map.

I have a list that I'm working on and the coordinate are
expressed this way: 43°32'53" x 74°35'00".
I'd like an easy way to convert them to this format: N43.63313 W74.57810

A friend suggested posting it on a GPS board but I thought that there's enough expertise on VFTT that I wouldn't have to join another board to find a solution I can understand.

Thanks for anyone who can assist with this project.

PB
Straightforward.

You are converting from DD MM SS to DD.ddddd

("DD" are the degrees, "MM" are the minutes, "SS" are the seconds and ".dddd" is the decimal fraction part of the degrees in the new format)

DD.ddddd = DD + MM/60 + SS/3600

So in your example you have

DD.ddddd = 43° + 32'/60 + 53"/3600

DD.ddddd = 43 + .53333 + .01472

DD.ddddd = 43.54806

Similarly for the longitude.
 
43° 32' 53" x 74° 35' 00".

There are two parts here, separated by the x. The process of conversion is identical for each part, so let's start with the first part:

43° 32' 53"

sanity check: since there are 60 minutes in a degree, 43 degrees and 32 minutes (plus some seconds) should be just a bit more than halfway between 43 degrees and 44 degrees. So if we don't mess up, our final answer will be slightly more than 43.5 degrees.


Let's find out exactly what 32 minues is in degrees:
32/60 =
... drum roll ...
0.5333333333333333333333

(This number actually goes on forever, but we don't care. Keep as many digits as your calculator can handle, but ten digits will be plenty.)

So 43 deg 32 minutes is 43.533333333333 degrees.
Sanity check: slightly larger than 43.5. Check!

But we're not done, we've forgotten about the 53 seconds.
60 seconds in a minute, so:
53/60 =
0.8333333333333 minutes
(sanity check: 53 is most of 60, so we'd expect the first digit to be big-ish, like 8 or maybe 9. Looks good.)
Still have to convert this from minutes to degrees:
0.833333333/60 =...
0.01472222222
(sanity check: should be smaller than 1/60 (0.01666) and bigger than 0.5/60 (0.008333333). Check.)

We have to add those 53 seconds to what we calculated previously:
43.533333333333 + 0.01472222222 =
(...drum roll....)
43.548055555555


As for "optimizing the algorithm", rather than dividing the seconds by 60 twice (once to get to minutes, again to get degrees), it's faster (and less error-prone) to divide the seconds (once) by 3600, getting to degrees in a single step. (it's equivalent since 60*60=3600), as Papa bear suggested.
 
What if a person had ohhh, say, 770 such coordinates and wanted to change them all in one fell swoop?
 
What if a person had ohhh, say, 770 such coordinates and wanted to change them all in one fell swoop?
Load them into a spread sheet and go!

I do it all the time with lists of benchmark coordinates. Like the 3500 odd points on the Canadian border in the northeast.
 
As a footnote, since I know there more than a few users of the National Geographic Topo software, when you are setting waypoints it gives you the option to display either D-M-S or Decimal.
 
What if a person had ohhh, say, 770 such coordinates and wanted to change them all in one fell swoop?
An awk or perl script :D

Or, for those who know neither language, an excel spreadsheet. get the degrees, minutes and seconds in columns A to C, calculate result in column D:

Dn = An + Bn/60 + Cn/3600

for row n.
 
you could do it in one button click on your calculator on your computer if you wanted to go from decimal to degrees.

(1) From the START button, click Programs->Accessories->Calculator (duh) :p
(2) From the Calculator's View menu click Scientific :cool:
(3) Enter the coordinate in decimal degrees (example: 42.36824)
(4) Click the 'dms' button :rolleyes:
(5) The DMS value will appear, as follows: 42.2205664, which translates to 42 deg., 22 min., 06 sec. :D

i'm sure you can do it the other way also, but i'm too lazy to figure it out.
 
Neil, if you can provide a consistently-formatted list in electronic form, any halfway competent programmer can write a loop that will apply the formula above as many times as needed. Ask them nicely, and it'll print the results too. :)
 
You can let your GPS do the conversion, at least my ancient Etrex Vista had the option to switch coordinate systems such that if you plug in DD.MM.SS. and change the settings, you'd get the converted coordinates. It's kind of slow and clunky but it does work.

Otherwise, there are online references out that that will convert or many scientific calculators will convert basic units...

here's an interesting one that converts US Postal street addresses to Lat/Long:

http://www.stevemorse.org/jcal/latlon.php

It has other converters too..

Jay
 
Don't forget to maintain a consistent datum throughout your conversions.
 
Neil, if you can provide a consistently-formatted list in electronic form, any halfway competent programmer can write a loop that will apply the formula above as many times as needed. Ask them nicely, and it'll print the results too. :)

Someone tell me what format your data is in and I can write it up pretty quick (since I'm just sitting around watching the election)
 
Top