Skip to content

dizley/dmsdec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dmsdec

Python module for converting longitudes/latitudes between Degrees, Minutes, Seconds format and decimal format.

Usage

Import dmsdec module

>>> import dmsdec

To convert from Degrees/Minutes/Seconds to Decimal

>>> print(dmsdec.dms2dec(('50 3 58.76N', '5 42 53.1W')))
>>> (50.066322, -5.71475)

The conversion function dms2dec takes a tuple containing two strings (longitude, latitude) as the argument and returns a tuple containing two floats, the converted longitude and latitude.

To convert from Decimal to Degrees/Minutes/Seconds

>>> print(dmsdec.dec2dms((50.06632, -5.71475)))
>>> ('50 3 58.76N', '5 42 53.1W')

The conversion function dec2dms takes a tuple containing two floats (longitude, latitude) as the argument and returns a tuple containing two strings, the converted longitude and latitude.

About

Convert Long/Lat between Degrees/Minutes/Seconds and Decimal formats.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages