Created
February 28, 2013 01:15
-
-
Save tsemerad/5053378 to your computer and use it in GitHub Desktop.
Python function for converting degrees, minutes, seconds (DMS) coordinates to decimal degrees (DD).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dms_to_dd(d, m, s): | |
dd = d + float(m)/60 + float(s)/3600 | |
return dd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks, just found it
def dms_to_dd(d, m, s):
if d[0]=='-':
dd = float(d) - float(m)/60 - float(s)/3600
else:
dd = float(d) + float(m)/60 + float(s)/3600
return dd