This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OpenPlotter data to Python
#17
(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'] )
Reply


Messages In This Thread
OpenPlotter data to Python - by Jodel - 2021-02-06, 10:31 PM
RE: OpenPlotter data to Python - by PaddyB - 2021-02-07, 09:45 AM
RE: OpenPlotter data to Python - by Jodel - 2021-02-07, 06:28 PM
RE: OpenPlotter data to Python - by PaddyB - 2021-02-07, 09:17 PM
RE: OpenPlotter data to Python - by Jodel - 2021-02-07, 10:15 PM
RE: OpenPlotter data to Python - by PaddyB - 2021-02-07, 10:32 PM
RE: OpenPlotter data to Python - by Jodel - 2021-02-07, 11:40 PM
RE: OpenPlotter data to Python - by tkurki - 2021-02-08, 07:10 AM
RE: OpenPlotter data to Python - by Jodel - 2021-02-08, 12:42 PM
RE: OpenPlotter data to Python - by PaddyB - 2021-02-08, 04:21 PM
RE: OpenPlotter data to Python - by Sailoog - 2021-02-08, 08:30 PM
RE: OpenPlotter data to Python - by Jodel - 2021-02-10, 07:46 PM
RE: OpenPlotter data to Python - by Sailoog - 2021-02-10, 08:21 PM
RE: OpenPlotter data to Python - by Sailoog - 2021-02-10, 08:29 PM
RE: OpenPlotter data to Python - by Jodel - 2021-02-10, 09:18 PM
RE: OpenPlotter data to Python - by Hillzzz - 2023-12-18, 07:58 PM
RE: OpenPlotter data to Python - by PaddyB - 2023-12-19, 11:18 AM
RE: OpenPlotter data to Python - by DroZDi - 2024-01-11, 11:28 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)