How to convert degree minute second to degree decimal

后端 未结 6 2262
小鲜肉
小鲜肉 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 13:54

    I have slightly modified the re:

    parts = re.split('[^\d\w\.]+', dms)
    

    And as @Falko advised to make it work, you can either use double double quotes or escape your quotes characters

    parse_dms("53°19\'51.8\"N")
    

提交回复
热议问题