Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iliasmachairas/d73bf4162b742e2b9acf2c4dbc1339b1 to your computer and use it in GitHub Desktop.
Save iliasmachairas/d73bf4162b742e2b9acf2c4dbc1339b1 to your computer and use it in GitHub Desktop.
path_shp = "F:\\Tutorials\\Layout_plot_qgis\\periphereies (1)\\periphereies\\periphereies.shp"
prefectures = QgsVectorLayer(path_shp, 'prefectures', 'ogr')
prefectures.loadNamedStyle(style_prefecture_path)
if not prefectures.isValid():
print("Layer failed to load!")
else:
QgsProject.instance().addMapLayer(prefectures)
individual_prefecture = QgsVectorLayer(filepath, filename_without_extension, 'ogr')
if not individual_prefecture.isValid():
print("Layer failed to load!")
else:
QgsProject.instance().addMapLayer(individual_prefecture)
individual_prefecture.loadNamedStyle(style_indiv_prefecture_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment