InsideDarkWeb.com

NMEA Data Feed into QGIS

We have a maritime simulator in our office we occasionally use for engineering studies…I was trying to figure out how to get a shape file of the path taken by the ship being driven into QGIS. Data is being sent to a PC with a charting software called Rosepoint on it in NMEA format over a TCP stream via a network cable. According to Rosepoint it is doing this via NMEA over TCP.

Initially hooking up QGIS I didn’t think it was seeing anything, I tried Global Mapper which really saw nothing as it wouldn’t even connect. It did however occur to me that with QGIS my lat/long were both 0 so it must at least be connecting with autoconnect. If I set the com port to something else it fails to connect all together.

So I’m assuming maybe this is working and it’s just not able to understand the sentences coming through…is there a way to define the format on my own, or something I’m not doing correctly??

Geographic Information Systems Asked on November 12, 2021

2 Answers

2 Answers

Seems like QGIS doesn't support GPS over TCP directly, and the more layers of software on top of QGIS introduced reduce the likely hood it'll ever be allowed to be used on the system

Answered by tarnis on November 12, 2021

Try saving this script as "save_log.py", and then:

  1. Connect to your device via the QGIS GPS Information Panel
  2. Drag and drop the script over the qgis window
  3. Pick a destination file for the GPS log
  4. Leave it to record some points, and then disconnect the GPS from the QGIS GPS Information Panel

Attach some of the lines from the saved log file. It's possible that the device is reporting non-standard NMEA codes, so the log will help determine if that's the case.

from qgis.PyQt.QtWidgets import QFileDialog, QMessageBox
from qgis.core import QgsApplication

gps_list = QgsApplication.gpsConnectionRegistry().connectionList()
if not gps_list:
    QMessageBox.critical(None,'GPS Connection','Please connect to the GPS first')
else:
    gps = gps_list[0]
    assert gps

    dest, _ = QFileDialog.getSaveFileName(None, "Save GPS messages to", "gps.log", "Log files (*.log)")
    f = None
    if dest:
        f = open(dest,'wt')
            
    def printSentence(sentence):
        f.write(sentence + 'n')
        
    def closeLog():
        f.close()

    if dest:
        gps.nmeaSentenceReceived.connect(printSentence)
        gps.destroyed.connect(closeLog)

Answered by ndawson on November 12, 2021

Add your own answers!

Related Questions

Resolve Intersecting areas in shapefile

1  Asked on October 1, 2021 by user2331566

     

Making PostGIS polygons ready to use in ArcGIS

1  Asked on October 1, 2021 by stef-gootzen

       

Get central meridian, PyProj?

1  Asked on October 1, 2021 by user1565760

   

Intersecting line at junction in PostgreSQL

2  Asked on September 30, 2021 by nihcas

     

ArcPy “Cannot open table for Load” error

1  Asked on September 30, 2021 by mac-maclean

   

How do you add a Trend Line to a Graph in ArcGIS?

0  Asked on September 30, 2021 by olatunde-opeyemi

       

How to get the URL path to a layer in Geoserver?

2  Asked on September 30, 2021 by dpsspatial_boycottinggisse

 

Slow loading of QGIS Project

4  Asked on September 30, 2021 by rostranimin

     

lidR: Save LAS files from a clip_roi list

1  Asked on September 30, 2021 by aleksandra-zaforemska

         

KML driver failed to create

1  Asked on September 30, 2021

     

Ask a Question

Get help from others!

© 2021 InsideDarkWeb.com. All rights reserved.