Bug report #4819

"Identify Features" tool is slow with complex/big features (lot of nodes)

Added by Giovanni Manghi about 12 years ago. Updated over 9 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Canvas
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:14665

Description

This happens with lines/polygons above a certain level of complexity (number of nodes). To test you can use the same vector that was used as test case in ticket #4523

http://www.faunalia.pt/downloads/test_slow_vector.zip

0001-4819_01.patch Magnifier (1.72 KB) Thomas Arnold, 2012-06-22 01:44 AM

sssi_problem.zip (1.03 MB) James Stott, 2012-06-26 01:06 AM

slow_pan.zip (195 KB) James Stott, 2012-06-26 02:15 AM

sssi_Identify.jpg - result after the use of identify feature tool (sssi_example) with the 0001-4819_01.patch (162 KB) Thomas Arnold, 2012-06-26 02:43 AM

vegetacao_potencial.zip (441 KB) Alexandre Neto, 2013-09-23 08:59 AM


Related issues

Related to QGIS Application - Bug report #7834: Bad Allocation on Identify - v1.8 Closed 2013-05-15

Associated revisions

Revision ed1e19f9
Added by Vincent Mora over 10 years ago

fix #4819
improves rendering speed of complex rubberbands

History

#1 Updated by Giovanni Manghi almost 12 years ago

  • Priority changed from 6 to High

#2 Updated by Giovanni Manghi over 11 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0
  • Affected QGIS version changed from master to 1.8.0

see also #5831

#3 Updated by Thomas Arnold over 11 years ago

hi,

if I load the example data "test_slow_vector.zip" and than selecting a feature qgis hangs after the method poly.subtracted( ring ) is calling in QgsHighlight::paintPolygon(...).
In the following patch I use QPainterPath to draw Polygons.

#4 Updated by Giovanni Manghi over 11 years ago

  • Pull Request or Patch supplied changed from No to Yes

#5 Updated by James Stott over 11 years ago

I am getting this problem too. The Identify Results window just goes blank and says 'Not Responding'. I have not found out how long it takes to return the results as I have have closed QGIS as it takes too long. It happens whether the data is in a shapefile or a postgis layer.

I have included an example of a polygon from the dataset that causes the problem. The polygon has over 80000 nodes. There are other polygons in this dataset that also do not work. The whole dataset is available from http://www.gis.naturalengland.org.uk/pubs/gis/GIS_Register.asp and is the Sites of Special Scientific Interest (England-wide) dataset.

#6 Updated by James Stott over 11 years ago

I have also noticed, that if I can get a polygon to identify without hanging, then if I keep it highlighted from the identify tool (in red) and pan, the panning is very slow. Once the polygon that is selected by the identify tool is off screen, panning speeds up again.

To reproduce, use identify tool to select polygon, now pan the map.

Example polygon attached.

#7 Updated by Thomas Arnold over 11 years ago

Hi,

did you use the patch? With the patch the selecting of the a feature with the identify feature tool in the sssi_problem example works ok for me (see sssi_Identify.jpg). I'm working with qgis 1.8 on windows 7 with osgeo installation.

#8 Updated by Giovanni Manghi over 11 years ago

Thomas Arnold wrote:

Hi,

did you use the patch? With the patch the selecting of the a feature with the identify feature tool in the sssi_problem example works ok for me (see sssi_Identify.jpg). I'm working with qgis 1.8 on windows 7 with osgeo installation.

I didn't had the time to try the patch yet, but please if it works (and I'm sure it does) then raise the issue in the dev mailing list. I have one it a couple of days ago but had no answers. This is a huge usability issue, and it is not tagged as blocker just because is not a regression.

#9 Updated by James Stott over 11 years ago

No. How do I apply the patch to test it? using osgeo4w.

#10 Updated by Thomas Arnold over 11 years ago

Giovanni Manghi wrote:

Thomas Arnold wrote:

Hi,

did you use the patch? With the patch the selecting of the a feature with the identify feature tool in the sssi_problem example works ok for me (see sssi_Identify.jpg). I'm working with qgis 1.8 on windows 7 with osgeo installation.

I didn't had the time to try the patch yet, but please if it works (and I'm sure it does) then raise the issue in the dev mailing list. I have one it a couple of days ago but had no answers. This is a huge usability issue, and it is not tagged as blocker just because is not a regression.

Thank you for trusting in the patch ;-). I had read the dev mailing list and it seem to me that the dev has a lot to do with the qgis 1.8 release. I am very confident that in a few days a developer will look at this ticket.

James Stott wrote:

No. How do I apply the patch to test it? using osgeo4w.

It is a source code patch. There are two ways: ether (easy way) wait some days until the patch will accepted and applied (than install qgis-dev) or (difficult way) download the source code, apply the patch with git apply ????.patch and building QGIS from source as descriped in http://www.qgis.org/api/INSTALL.html#toc14.

#11 Updated by Magnus Homann over 11 years ago

  • Status changed from Open to Closed

This seems to be applied in master.

#12 Updated by Giovanni Manghi over 11 years ago

Magnus Homann wrote:

This seems to be applied in master.

it seems so, now it is usable and does not freeze even if it is not lightning fast, but anyway is ok.

#13 Updated by Andre Joost almost 11 years ago

  • Status changed from Closed to Reopened

The problem still exists, see #7834 and http://gis.stackexchange.com/questions/60678/qgis-bad-allocation-exception-on-identify
Zoomed to extent, identify works, but with high zoom levels (1:1000 or less) a permanent "Bad Allocation" error occurs.

Current Master on Windows XP exits without any message.

On Ubuntu, Lisboa and Master work without problem.

#14 Updated by Giovanni Manghi almost 11 years ago

  • Priority changed from High to Severe/Regression

#15 Updated by Giovanni Manghi almost 11 years ago

  • Affected QGIS version changed from 1.8.0 to master

#16 Updated by Salvatore Larosa over 10 years ago

identify on the attached sample data is very slow but works as expected, no error message here !

and is it correct to consider it as blocker ??

#17 Updated by Regis Haubourg over 10 years ago

Hi, I'm just about to fund some work on this because we have some huge datasets, and this really is a blocker.
PLease keep it opened ;-)

#18 Updated by Vincent Mora over 10 years ago

  • Assignee set to Vincent Mora

#19 Updated by Vincent Mora over 10 years ago

I tried with current master in debug on a good laptop (lenovo w530 proc i7) with the dataset httpp://www.faunalia.pt/downloads/test_slow_vector.zip.

The identify feature tool takes ~5sec to appear after clicking. The pan becomes slow: ~5sec between drag/drop and refresh.

Since it's a perf issue, it's difficult for me to define an acceptable target.

Can someone tell me:
- What is max acceptable time for identify feature and for pan ?
- Is the mentioned dataset big enough ? If not please provide a dataset in relation with the requierements.

#20 Updated by Giovanni Manghi over 10 years ago

  • Status changed from Reopened to Feedback

Vincent Mora wrote:

I tried with current master in debug on a good laptop (lenovo w530 proc i7) with the dataset httpp://www.faunalia.pt/downloads/test_slow_vector.zip.

The identify feature tool takes ~5sec to appear after clicking. The pan becomes slow: ~5sec between drag/drop and refresh.

Since it's a perf issue, it's difficult for me to define an acceptable target.

Can someone tell me:
- What is max acceptable time for identify feature and for pan ?
- Is the mentioned dataset big enough ? If not please provide a dataset in relation with the requierements.

Note: the patch has apparently not been integrated in the master. I will try it before anything else.

Vincent,
I didn't tested this issue in a while and it seems to me that with the latest qgis master the issue in not an issue anymore!

Before the attached datasets were bringing qgis to freeze completely, now the identify tool is working! The lag is acceptable for me, we are speaking of features with many thousands of nodes.

What is the opinion of the other people?

#21 Updated by Giovanni Manghi over 10 years ago

  • Crashes QGIS or corrupts data changed from Yes to No
  • Status changed from Feedback to Open
  • Priority changed from Severe/Regression to Normal

regis Haubourg wrote:

Hi, I'm just about to fund some work on this because we have some huge datasets, and this really is a blocker.
PLease keep it opened ;-)

I have tested (with a i3 computer and in Windows VM) my original dataset linked in the description, as well other datasets that were known to be problematic with the identify tool (causing a complete freeze of the program) and I cannot see anymore any kind of freeze.

Maybe it is somehow slow (a few seconds to identify features with many thousands of nodes), probably it can be improved, but certainly I think we can downgrade this issue as it is not anymore a huge usability issue of a very common (q)gis tool.

#22 Updated by Giovanni Manghi over 10 years ago

  • Subject changed from QGIS hangs when selecting a feature with the "Identify Features" tool to "Identify Features" tool is slow with complex/big features (lot of nodes)

#23 Updated by Vincent Mora over 10 years ago

Is there a reason why the feature is highlighted but not selected by the tool ?

Because, if there isn't, the rendering of selected features is smooth and nice, while the rendering of highlighted feature is really slow (this is the problem here).

Of course it's possible to investigate further in order to make the highlight as fast as the selection highlight... but this is more complicated that simply selecting the feature we want to identify.

#24 Updated by Giovanni Manghi over 10 years ago

Vincent Mora wrote:

Is there a reason why the feature is highlighted but not selected by the tool ?

sorry I don't understand

Because, if there isn't, the rendering of selected features is smooth and nice, while the rendering of highlighted feature is really slow (this is the problem here).

for example while doing a pan/zoom, right? I see now... panning/zooming the map with a (complex/big) identified/highlighted feature is a bit slow.

Of course it's possible to investigate further in order to make the highlight as fast as the selection highlight... but this is more complicated that simply selecting the feature we want to identify.

it seems anyway that this slowness affects qgis only when a big/complex features is identified, so I guess we can still tag this as something to improve, but definitely not a blocker: it is not a regression (actually improved a lot), and right now it is not causing freeze/crash).

#25 Updated by Vincent Mora over 10 years ago

Giovanni Manghi wrote:

Vincent Mora wrote:

Is there a reason why the feature is highlighted but not selected by the tool ?

sorry I don't understand

The identify feature tool does not make the mouse clicked feature the current selection. Instead it highlights it (not the same mechanism as selection).

Since the selection mechanism works fine (even in debug, there is no lag in pan), I wondered if there was a reason not to select the mouse clicked feature we want to identify (with the selection mechanism: polygon fill yellow).

#26 Updated by Vincent Mora over 10 years ago

  • Status changed from Open to Feedback

In order to benefit from the speed of the V2 renderer, I propose to add the parameter "highlighted" (along with "selected") to QgsFeatureRendererV2::renderFeature and get rid of QgsHighlight altogether.

Does someone see any reason not to do so ?

#27 Updated by Giovanni Manghi over 10 years ago

Does someone see any reason not to do so ?

Hi Vincent, better ask on the dev mailing list. Cheers!

#28 Updated by Vincent Mora over 10 years ago

  • Status changed from Feedback to Resolved
  • Resolution set to fixed

Eventually I just pruned polygon points that where less than a pixel apart. Works like a charm for polygons with over 75k vertices (in http://www.faunalia.pt/downloads/test_slow_vector.zip)

Pull request here:
https://github.com/qgis/Quantum-GIS/pull/747

#29 Updated by Vincent Mora over 10 years ago

  • Assignee deleted (Vincent Mora)
  • Status changed from Resolved to Closed

Bug fixed thanks to fundings from Agence de l'Eau Adour-Garonne.

#30 Updated by Alexandre Neto over 10 years ago

I can still experience this problem while using identify in a polygon with over 20k vertex. This happens only at bigger scales (~1:800).

QGIS 2.0.1 (32bit) in Windows 7.

In attacthment with the shapefile, the big polygon has OBJECTID = 45

Should this ticket be opened again?

Thanks!

#31 Updated by Matthias Kuhn over 10 years ago

Can you try to verify this on another system?

The 32 bit windows version is still using an older Qt version which could be cause/part of the problem. In this case it should be updated on OSGeo4W instead and is not a QGIS issue.

#32 Updated by Giovanni Manghi over 10 years ago

Alexandre Neto wrote:

I can still experience this problem while using identify in a polygon with over 20k vertex. This happens only at bigger scales (~1:800).

QGIS 2.0.1 (32bit) in Windows 7.

In attacthment with the shapefile, the big polygon has OBJECTID = 45

Should this ticket be opened again?

Thanks!

I confirm the issue on qgis32/Win but not on Linux where the identify is lightning fast and give no errors. On the other hand on Win at the described scales gives a "bad allocation" error and ultimately leads to qgis crash.

#34 Updated by Jürgen Fischer about 10 years ago

  • Status changed from Closed to Reopened

#35 Updated by Giovanni Manghi over 9 years ago

  • Status changed from Reopened to Closed
  • Resolution set to invalid

for what I can see the issue is fixed also on qgis 32 bit on Windows, reopen if necessary.

Also available in: Atom PDF