This python script works great for me when importing multiple gpx files from Strava.
Replace path/to/gpx/folder with the path to your gpx files.
Open the python console in QGIS and run following code.
import os
path = "path/to/gpx/folder"
names = ["waypoint", "route", "track", "route_point", "track_point"]
for dirpath, subdirs, files in os.walk(path):
for f in files:
for name in names:
iface.addVectorLayer(os.path.join(dirpath, f)+"?type="+name, name, "gpx")
import os
path = "path/to/gpx/folder"
names = ["track"]
for dirpath, subdirs, files in os.walk(path):
for f in files:
for name in names:
iface.addVectorLayer(os.path.join(dirpath, f)+"?type="+name, name, "gpx")
- Import only track layer and name like file name:
import os
path = "path/to/gpx/folder"
names = ["track"]
for dirpath, subdirs, files in os.walk(path):
for f in files:
for name in names:
iface.addVectorLayer(os.path.join(dirpath, f)+"?type="+name, f, "gpx")