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
<
For multiple coordinates, you can read them in using pandas. Formatting is important - there should not be any white spaces. White spaces can be removed using the replace function. The outputs can be easily saved as a text file or spreadsheet. I just printed them for validation and rounded the decimals locations out to 4.
### read input file
df = pd.read_excel('dms.xlsx')
n = len(df)
for i in range(n):
Lat_d = round(parse_dms(df.Lat[i].replace(" ", "")),4)
Long_d = round(parse_dms(df.Long[i].replace(" ", "")),4)
print(Lat_d, Long_d)