Bug report #21240

Map Compose: adding/moving legend is very slow with large projects

Added by Cesar Herrera about 5 years ago. Updated almost 5 years ago.

Status:Open
Priority:High
Assignee:-
Category:Map Composer/Printing
Affected QGIS version:3.4.4 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29058

Description

In map composer, when you want to create a new legend, if you have several items, the creation is extremely slow.
(2.18 was faster)

2.gpkg (548 KB) Cesar Herrera, 2019-02-14 07:58 AM

3.gpkg (1.04 MB) Cesar Herrera, 2019-02-14 07:58 AM

4.gpkg (808 KB) Cesar Herrera, 2019-02-14 07:58 AM

6.gpkg (3.1 MB) Cesar Herrera, 2019-02-14 07:58 AM

INV.gpkg (120 KB) Cesar Herrera, 2019-02-14 07:58 AM

7.gpkg (3.09 MB) Cesar Herrera, 2019-02-14 07:58 AM

INV-2.gpkg (120 KB) Cesar Herrera, 2019-02-14 07:58 AM

LEGEND-SLOW.qgz (30.6 KB) Cesar Herrera, 2019-02-14 07:58 AM

History

#1 Updated by Nyall Dawson about 5 years ago

  • Status changed from Open to Feedback

Can you elaborate? What exactly is the issue here?

#2 Updated by Cesar Herrera about 5 years ago

When you have several layers in a GIS project and then you move to the map composer and you want to create a legend it takes a lot of time. Example: I'm working with around 50 layers (not very complex layers) and when you create the legend you have to wait around 5 minutes till all the layers are showed in the legend. Then, if you move the legend or modify the layers showed in the legend it also takes a lot of time

#3 Updated by Giovanni Manghi about 5 years ago

Cesar Herrera wrote:

When you have several layers in a GIS project and then you move to the map composer and you want to create a legend it takes a lot of time. Example: I'm working with around 50 layers (not very complex layers) and when you create the legend you have to wait around 5 minutes till all the layers are showed in the legend. Then, if you move the legend or modify the layers showed in the legend it also takes a lot of time

can you possibly attach/link a sample project with data?

#4 Updated by Steve Lowman about 5 years ago

I think I can support this. We have hundreds of layers in our GIS. I just tried adding a legend with the Add Legend tool, and it took a long time to appear. Then, with the legend visible in the layout, the whole application is very slow to respond to any command, so bad, in fact, that I think I may have to terminate the application from Windows.

I never liked that the legend appears with all layers already in it, so we add legends from a set of Legend .qpt templates, formatted for different page sizes, which appear with no layers added, so then we can just add the layers we want.

Because we do it that way, I really like that you can add multiple layers in one command in QGIS 3, because it was always an annoyance to have to add them one-at-a-time in QGIS 2.

I suggest it would be far preferable for the Add Legend tool to create an empty legend by default, or maybe in the 'New Item Properties' dialog for legends, have three radio button options for the user to choose Add empty legend, Add with visible layers only, or Add with all layers.

#5 Updated by Cesar Herrera about 5 years ago

Including a nonreal QGIS project. I adapted some layers and QGZ file in order to reproduce the problem.

#6 Updated by Giovanni Manghi about 5 years ago

Cesar Herrera wrote:

Including a nonreal QGIS project. I adapted some layers and QGZ file in order to reproduce the problem.

I tested on my clean Windows and Linux testing VMs, and add the legend does not take more than 2/3 seconds (which is ok to me considered its size).

#7 Updated by Giovanni Manghi about 5 years ago

I tested on my clean Windows and Linux testing VMs, and add the legend does not take more than 2/3 seconds (which is ok to me considered its size).

can you please test again on the latest versions and on new/clean profile?

#8 Updated by Steve Lowman almost 5 years ago

I tested using the current versions (not master) of 3.6.1 and 3.4.6. I tried installing the nightly master of 3.4.6, but there seems to be something wrong with the OSGeo4W network installer - failing to copy some essential files or environment path variables or something.

Anyway, for the versions that I tested, using our very large .qgz project the time to add a legend varied between 74 seconds (on Citrix) and 230 seconds (on Windows laptop). Once the legend was completed, then the time taken to respond to a click on another item was between 38 seconds (Citrix) and 70 seconds (laptop).

You would probably agree that these are not okay performances.

#9 Updated by Giovanni Manghi almost 5 years ago

Steve Lowman wrote:

I tested using the current versions (not master) of 3.6.1 and 3.4.6. I tried installing the nightly master of 3.4.6, but there seems to be something wrong with the OSGeo4W network installer - failing to copy some essential files or environment path variables or something.

Anyway, for the versions that I tested, using our very large .qgz project the time to add a legend varied between 74 seconds (on Citrix) and 230 seconds (on Windows laptop). Once the legend was completed, then the time taken to respond to a click on another item was between 38 seconds (Citrix) and 70 seconds (laptop).

You would probably agree that these are not okay performances.

can you add/link such project?

#10 Updated by Steve Lowman almost 5 years ago

Hi. Sorry, I can't do that. Our project has far too many layers, and many of them are subject to copyrights.

#11 Updated by Steve Lowman almost 5 years ago

I also just tested using Cesar's project and layers. The legend loading and other performance timings were okay with that one, so it does not reproduce the problem that you get with a lot more layers.

#12 Updated by Giovanni Manghi almost 5 years ago

Steve Lowman wrote:

Hi. Sorry, I can't do that. Our project has far too many layers, and many of them are subject to copyrights.

can you say if with the same type of project things were better in 2.18?

#13 Updated by Steve Lowman almost 5 years ago

I just tested the same project in 2.18, and the Add Legend tool worked fine rendering the legend with all the layers listed almost instantly, and then no delay in selecting a different item.

I also tested a .qgs project in 3.4, and I can confirm the problem occurs in 3.4 for both .qgz and .qgs projects.

It was a slightly better performance for the .qgs project, taking approx 60 seconds to add the legend and then 30 seconds to select a different item, but I only tested it once, so the small difference compared to last week's test of the same project as .qgz might have been for no particular reason.

#14 Updated by Giovanni Manghi almost 5 years ago

  • Regression? changed from No to Yes
  • Priority changed from Normal to High
  • Status changed from Feedback to Open
  • Subject changed from Map Composer - Legend to Map Compose: adding/moving legend is very slow with large projects

Also available in: Atom PDF