How to convert degree minute second to degree decimal

后端 未结 6 2260
小鲜肉
小鲜肉 2021-02-07 13:37

I receive the latitude and longitude from GPS with this format:

Latitude : 78°55\'44.29458\"N

I need convert this data to:

latitude: 78.9288888889

<
6条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-07 14:06

    The function above (dms2dd) is incorrect.

    Actual (With error):

    if direction == 'E' or direction == 'N': dd *= -1

    Corrected Condition:

    if direction == 'W' or direction == 'S': dd *= -1

提交回复
热议问题