PyQGIS method to add multiple GDB files?

المشرف العام

Administrator
طاقم الإدارة
I can use the following to add multiple shapefiles to QGIS:

import os, globlayers=[]shape_path = "C:\Users\Me\Desktop\Test\Shapefiles\\"for shape in glob.glob(shape_path + "*.shp"): layer = QgsVectorLayer(shape, os.path.basename(shape), "ogr") layers.append(layer)QgsMapLayerRegistry.instance().addMapLayers(layers)However, I have dozens of .gdb folders which I would like to add automatically (I can do this individually through Layer > Add Vector Layer but would be quite tedious).

Is there a similar, or albeit another, method using PyQGIS to add multiple GDB files?



أكثر...
 
أعلى