Is there a tool or panel in QGIS 3 that allows a user to view the map layers by data source? Similar to the List By Source view in the ArcMap Table of Contents?
enter image description here

I thought I had come across it, but now I can't find it. Perhaps I dreamt it up or perhaps I'm searching with the wrong vocabulary.

Does this capability exist in the core QGIS software? Or a plugin?


You can get the list of the layers in the current project with a PyQGIS script like this:

from qgis.core import QgsProject
lnames = [layer.name() for layer in QgsProject.instance().mapLayers().values()]

To access the PyQGIS console: Plugins -> Python Console

this produces a list of layers in the current project:

['GoogleSat', 'MyPointsLayer', 'Roads', 'House_numbers']

(Not by source though)

Other scripts you might find useful can be found in the PyQGIS Cookbook: https://docs.qgis.org/3.4/en/docs/pyqgis_developer_cookbook/cheat_sheet.html#layers


The Change Data Source Plugin https://plugins.qgis.org/plugins/changeDataSource/ will give you a list of all the layers in the file and their locations.

  • The plugin is nice and very usefull but it also just lists the layers and source and does not s o r t the layers by source – maxwhere Jan 28 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.