How to get the layers of a list of QGIS projects using PYQGIS

preview_player
Показать описание
How to list layers from QGIS projects using PYQGIS

A usual task for someone that has to deal with several QGIS projects is to have a list of all the layers that are part of a project, their paths and some other information. This proves very beneficial when you need to know where all your different layers are located and save in a CSV or spreadsheet to plan the migration of layers or simply to have an inventory.

Timestamps
00:00 Intro
00:50 Get the project filename
01:49 Get the project number of layers
02:34 Get the project CRS
04:14 Make print for debug look better
05:07 Get Project layers
07:26 Exporting list of layers as a CSV file
10:37 Reading QGZ projects from a directory to get layers and export
13:35 Add timestamp to CSV export name
14:56 Add project name to CSV file export
16:17 Communicating information to users

#qgis #gis #antoniolocandro #100DaysOfPYQGIS #pyqgis
Рекомендации по теме
Комментарии
Автор

wow. this is amazing, I am new to pyqgis, this help me a lot. Thanks!

techwithsibro
Автор

Just what I needed, great explanation. Thanks!!!

koryarizonawd
Автор

thanks for your explanation, actually i'm looking to get the layers ordered like in "layers panel" not alphabetically , can you please give me a tip

mustaphatitou