Hi @pat.molloy. The provided example returns location data in NMEA format. Therefore, if you convert your Lat-Lon value to decimal format, you will obtain the coordinates as you specified.
This little function seems to work, you pass in loc[0] for latitiude, loc[1] for longitude …
def nmea_to_dec (loc):
# Expects an NMEA format GPS location, converts to decimal
# NMEA is (d)ddmm.mmmm[NSEW] e.g. "5131.7131N" (which converts to float 51.528551)
if(loc[-1] == "S" or loc[-1] == "W"):
mult = -1.0 # negative if S or W
else:
mult = 1.0 # positive if N or E
a = float(loc[0:-1]) # get rid of the last character and convert to float from string
b = int(a/100)
c = b +((a-(b*100))/60) # convert the minutes to decimal
return(c*mult)
@pat.molloy I recently came across an interesting optimization idea.
If you look in the document called “GNSS Application Note” on page 48 you would see there are six modes labeled 0 to 5. The SDK by default uses 0 (The response of AT+QGPSLOC? is the same as that of AT+QGPSLOC=0).
If you navigate to gps.py in the SDK at line 104 and modify the command to command = “AT+QGPSLOC=2” then there is no need for conversion which can help save resources on the pi.