Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line layer labeling eats up all memory #14066

Closed
qgib opened this issue Jul 14, 2011 · 13 comments
Closed

Line layer labeling eats up all memory #14066

qgib opened this issue Jul 14, 2011 · 13 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Labeling Related to QGIS map labeling
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Jul 14, 2011

Author Name: Sandro Santilli (@strk)
Original Redmine Issue: 4083
Affected QGIS version: master
Redmine category:labelling


At high zoom levels, layer with new layer labeling activated consume lots of memory. So much to eventually render the machine unusable.

Il'll attach a shapefile with the data I'm testing this with.

To reproduce:

  • Open the shapefile as a layer
  • Zoom in as much as possible on the left-most node
  • Enable labeling

This is happening as of 3ac604f (1.7.0+)

I haven't tried with POINT or POLYGON layers.


@qgib
Copy link
Contributor Author

qgib commented Jul 14, 2011

Author Name: Martin Dobias (@wonder-sk)


I am unable to reproduce the issue here. Could you please try to provide a sample project file with configured labeling and map canvas zoomed in?

@qgib
Copy link
Contributor Author

qgib commented Jul 14, 2011

Author Name: Sandro Santilli (@strk)


It's not that easy, as if I zoom in enough to reproduce the problem I end up being unable to get control of the machine, so have to kill qgis which then fails saving the project...

@qgib
Copy link
Contributor Author

qgib commented Jul 14, 2011

Author Name: Sandro Santilli (@strk)


The attache project is at a zoom level good enough to see memory growing. Zoom further to kill the machine...


  • 3340 was configured as bug4083.qgs

@qgib
Copy link
Contributor Author

qgib commented Jul 14, 2011

Author Name: Sandro Santilli (@strk)


Second version of project file manually tweaked to make the problem more visible.


  • 3341 was configured as bug4083-2.qgs

@qgib
Copy link
Contributor Author

qgib commented Jul 14, 2011

Author Name: Martin Dobias (@wonder-sk)


Thanks. Now I am able to reproduce the problem.

The labeling library tries to create a huge number of label candidates. The number of candidates is approximately (line length) / (label width) and that is a lot when zoomed in.

I think this should be solved by clipping lines that are not entirely in the view. This would also solve the problem of missing labels when zoomed in (= labels outside current extent).


  • assigned_to_id was configured as Martin Dobias

@qgib
Copy link
Contributor Author

qgib commented Jul 14, 2011

Author Name: Martin Dobias (@wonder-sk)


I have added clipping of input geometries in 17e864b which fixed that.

It's in master branch. I will rather not commit that to 1.7 branch since the clipping might have further side effects I am not aware of.


  • resolution was changed from to fixed
  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Apr 11, 2012

Author Name: Sandro Santilli (@strk)


I'm still using 1.7 and this remains the most hit issue I have. Your commit cherry-picks cleanly in 1.7, I'm giving it a try there. The worst that can happen with clipping is an exception, but since qgis uses the C-API it'll be a NULL return which you're handling by skipping labeling for that feature (if I read the code correctly).

I'm also guessing the patch is not in 1.8 as I don't see any other commit referenced in "Associated revisions". It'll be important to backport at least there IMHO.


  • pull_request_patch_supplied was configured as 0
  • crashes_corrupts_data was configured as 0
  • version was configured as master
  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented Apr 11, 2012

Author Name: Sandro Santilli (@strk)


Alright, I did hit one of those drawbacks pretty easily :)
That was: ST_Intersection returns a geometry of a different type, with the consequence of the code taking who knows what path, a popup window showing complaining about unknown geometry type and the UI entering the infinite rounding circle :) Oops

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2012

Author Name: Giovanni Manghi (@gioman)


can you test with master? thanks.


  • status_id was changed from Reopened to Feedback

@qgib
Copy link
Contributor Author

qgib commented Aug 6, 2012

Author Name: Alister Hood (@AlisterH)


  • category_id was changed from Symbology to Labelling

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was configured as Version 2.0.0

@qgib
Copy link
Contributor Author

qgib commented Sep 16, 2012

Author Name: Giovanni Manghi (@gioman)


Sandro Santilli wrote:

Alright, I did hit one of those drawbacks pretty easily :)
That was: ST_Intersection returns a geometry of a different type, with the consequence of the code taking who knows what path, a popup window showing complaining about unknown geometry type and the UI entering the infinite rounding circle :) Oops

it seems to work fine on the latest master, please leave feedback.


  • assigned_to_id removed Martin Dobias

@qgib
Copy link
Contributor Author

qgib commented Oct 4, 2012

Author Name: Giovanni Manghi (@gioman)


Closing for lack of feedback. I assume that this was fixed. Please reopen if necessary.


  • status_id was changed from Feedback to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Labeling Related to QGIS map labeling labels May 24, 2019
@qgib qgib added this to the Version 2.0.0 milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Labeling Related to QGIS map labeling
Projects
None yet
Development

No branches or pull requests

1 participant