Loading multiple GPX files at once?

Using Add Vector layer you can select multiple files by mouseclicking (at least on Windows), but you have to select for each GPX file what layer you want to add (most probably "tracks").

I guess this could be a good idea for a selfmade plugin, but I have not yet found the time to do that.


You could use the following code in your Python console. Load the .gpx file into QGIS and change the result_path to your desired location:

import processing

result_path = "C:/Users/You/Desktop/Test/Results//"
for layer in QgsMapLayerRegistry.instance().mapLayers().values():
    processing.runalg("gdalogr:convertformat", layer, 0, '', result_path + layer.name())

I know this is very late but it might help someone else...

I had exactly similar problem. I had to create a python script. Later on, I decided to contribute by creating a QGIS plugin.

What the plugin does is, it creates a single QGIS vector layer out of all GPX files in a selected path. You can convert the features into points, polygons or lines. You can choose for tracks, waypoints and routs. All gpx features will have the file name of the gpx as an attribute. The plugin is located in QGIS plugin repository with a name Batch GPS Importer or at this page https://plugins.qgis.org/plugins/batch_gps_importer/ you can read the documentation here.

If you still want to segregate them into separate layer, you could make selection and create a new layer.

Tags:

Gpx

Qgis