2023-12-19, 11:18 AM
(2023-12-18, 07:58 PM)Hillzzz Wrote: Hi Folks I found this thread because I am trying to input the GPS lat long position from signalK into my Python Program. Can anyone give me some pointers as my Python is not that great and I am a bit stuck. Thanks
Try this _
>>> import requests
>>> url = "http://10.10.10.1:3000/signalk/v1/api/vessels/urn:mrn:imo:mmsi:***********/navigation/position"
(put your mmsi here > *********)
>>> response = requests.get(url)
>>> print(response.text)
>>> import json
>>> res = json.loads(response.text)
>>> print("Lat = ", res['value']['latitude'], "Long = ", res['value']['longitude'] )