Add load_layer to the basic functions
This commit is contained in:
parent
ce515b5427
commit
c97ff67ca4
@ -2,6 +2,16 @@ import os
|
||||
import glob
|
||||
import time
|
||||
|
||||
from qgis.core import QgsProject, QgsVectorLayer
|
||||
|
||||
|
||||
def load_layer(path, layer_name):
|
||||
the_layer = QgsVectorLayer(path, layer_name, 'ogr')
|
||||
if not the_layer.isValid():
|
||||
print(f'{layer_name} failed to load!')
|
||||
else:
|
||||
QgsProject.instance().addMapLayer(the_layer)
|
||||
return the_layer, layer_name
|
||||
|
||||
def create_folders(directory, num_folders):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user