A QGIS plugin to visualize GPX-data as line-segments between track points - Salzburg Research Forschungsgesellschaft

A QGIS plugin to visualize GPX-data as line-segments between track points

The native GPS eXchange Format (GPX) file importer for the open-source geo-information software QGIS features multiple options to create vector layers. This includes the import of track points as a point dataset and the import of the whole track as a single linestring. If the GPX data contains attributes associated to the track points, only the track point option can be used to read and visualize those attributes. Visualizing them as line segments has not been possible so far. To overcome this missing feature, I have implemented the QGIS plugin “GPX Segment Importer” to visualize attributes as line segments between the track points.

A coworker working on the quality assessment of mobile communication networks asked me if there is an easy offline possibility to visualize the attributes of a GPX trajectory avoiding the use of online services (like ShowGPX) due to privacy concerns. I recommended using the open-source tool QGIS that offers a native GPX reader. This reader has an option to include the attributes with the “track_points”-layer, which results in a point layer. In my opinion, it is visually more appealing to visualize a trajectory as a line, especially if multiple attributes should be drawn next to each other. Therefore, I searched for an alternative. As I could not find one, I developed a QGIS plugin that creates line segments from the track points. The new plugin simply assembles linear geometries between successive track points and inserts the attributes of the latter track point. In order to manage the available attributes, I also provide options to (i) ignore attributes and to (ii) choose the most appropriate data type. Furthermore, it is possible to add the layer as a temporary layer or to write the layer to a file. Either way, you can visualize the resultant linear GPX segment layers with the extensive styling options available in QGIS.

Native GPX file import dialog in QGIS

 

Feature summary

  • Select one or multiple GPX files with the same data structure at once.
  • Read all attributes available with each track point. This includes the timestamp and the elevation as well as any other attributes added to a track point.
  • To gain full control over the data, you can edit the attribute table before creating the segment layer. The user can select the attributes that should be included in the layer, modify the attribute label and change the data type (integer, double, boolean or string) if the automatic type detection failed, e.g. at numeric data that contains “Null” or “None” values.
  • The plugin detects attributes that do not have a value and deselects it. Values can still be selected manually.
  • Create a temporary memory layer or write the layer to a file (Shapefile in current version, future plans are to switch to GeoPackage).

Screenshot of the plugin; a GPX file is selected and the user can manually edit the attribute table

 

Try the plugin right now: The plugin is available in the QGIS plugin repository. Just open the plugin repository through the QGIS menu „Plugins” > „Manage and Install Plugins” and search for „GPX Segment Importer“. Select it and press „Install plugin”. The tool can be accessed via the “Manage Layers Toolbar” or via the menu „Plugins” > „GPX Segment Importer”.

Currently, the plugin is ready for QGIS2. It will be upgraded for the recently released QGIS3 soon. The source code is available at Github. Feel free to help me improving the tool.

Simon Gröchenig

Simon Gröchenig is employed at Salzburg Research as Software Engineer. He focuses on the preparation, analysis and visualization of spatial and temporal data in traffic related projects. His research fields are Location Based Servies and the development of geo-(web)-applications using Open Source technologies.


Blog-Kategorie(n): ,
Artikel-Tags: , , ,
Salzburg Research Forschungsbereich(e):
Salzburg Research Forschungsschwerpunkt(e): Publiziert am 21. Dec 2017

Kommentare:

Leave a Reply

Your email address will not be published. Required fields are marked *