5

I often find myself working with QGIS projects that load too many layers. I'm talking about a mix of raster and vector layers, some with small file size, some very large file size. Most of them are stored and read from a central server in my office, and a few of them are read from my local PC or other PCs within the office network.

Some of the PCs where the data is stored respond fast, some take longer time to deliver the data.

Over time, as more layers are added, the loading time of the projects gets slower and slower. Removing layers from the project sounds easy, but it's not that easy in real life - it feels like I need them all at hand.

I wish I could find if there are any particular offenders that take a long time to load in QGIS. It could be because the file is large, or because they are stored in a slow PC. The chances are that there's just a few layers that take a long time to load, and removing those ones could greatly improve the loading time of the project.

That could be easily accomplished if there was a way to record the loading time of each layer when a QGIS project is opened - has anyone found a way to do that? Ideally, a script or plugin that writes a *.txt or *.csv file with the name of each layer loaded and the time in seconds it took to load it.

6
  • Possibly a duplicate question here? gis.stackexchange.com/questions/344664/… It looks like there is a profiler() under QGSapplication One of the groups is projectLoad
    – nr_aus
    Oct 20, 2021 at 2:12
  • 1
    That question is specific to QGIS projects, this question is specific to regular QGIS workspaces. So different questions
    – jberrio
    Oct 20, 2021 at 5:00
  • Do you mean the Layout Report Workspace?
    – nr_aus
    Oct 20, 2021 at 7:25
  • Does this answer your question? Measuring loading times in QGIS using PyQGIS? Oct 20, 2021 at 7:54
  • 1
    That one is close, but that question actually refers to rendering time of layers on display (e.g. each time you move the map). My question refers to when you open a workspace in QGIS, and QGIS reads all the layers, regardless of whether each layer is turned on or not.
    – jberrio
    Oct 20, 2021 at 9:52

1 Answer 1

7

Since QGIS 3.16 you can know the time it takes to load each layer from a QGIS project.

Go to View --> Panels --> Debugging/Development Tools and click on the Profiler in the left menu.

As soon as you load a QGIS project, a new category called Project Load will be available. Select it from the category list.

Finally, expand the entry called Reading map layers in the profiler tree to see all of the QGIS project layers and their corresponding loading time.

enter image description here

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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