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

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

Closed
qgib opened this issue Jan 16, 2012 · 35 comments
Closed

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

qgib opened this issue Jan 16, 2012 · 35 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Map and Legend Related to map or legend rendering
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Jan 16, 2012

Author Name: Giovanni Manghi (@gioman)
Original Redmine Issue: 4819
Affected QGIS version: master
Redmine category:map_canvas


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 #14441

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



Related issue(s): #16716 (relates)
Redmine related issue(s): 7834


@qgib
Copy link
Contributor Author

qgib commented Apr 15, 2012

Author Name: Giovanni Manghi (@gioman)


  • priority_id was changed from 6 to High

@qgib
Copy link
Contributor Author

qgib commented Jun 20, 2012

Author Name: Giovanni Manghi (@gioman)


see also #15306


  • fixed_version_id was changed from Version 1.8.0 to Version 2.0.0
  • version was changed from master to 1.8.0

@qgib
Copy link
Contributor Author

qgib commented Jun 21, 2012

Author Name: Thomas Arnold (Thomas Arnold)


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.


  • 4602 was configured as 0001-4819_01.patch

@qgib
Copy link
Contributor Author

qgib commented Jun 24, 2012

Author Name: Giovanni Manghi (@gioman)


  • pull_request_patch_supplied was changed from 0 to 1

@qgib
Copy link
Contributor Author

qgib commented Jun 25, 2012

Author Name: James Stott (@jamesstott)


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.


  • 4615 was configured as sssi_problem.zip

@qgib
Copy link
Contributor Author

qgib commented Jun 26, 2012

Author Name: James Stott (@jamesstott)


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.


  • 4616 was configured as slow_pan.zip

@qgib
Copy link
Contributor Author

qgib commented Jun 26, 2012

Author Name: Thomas Arnold (Thomas Arnold)


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.


  • 4617 was configured as sssi_Identify.jpg

  • sssi_Identify.jpg (Thomas Arnold) - result after the use of identify feature tool (sssi_example) with the 0001-4819_01.patch

@qgib
Copy link
Contributor Author

qgib commented Jun 26, 2012

Author Name: Giovanni Manghi (@gioman)


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.

@qgib
Copy link
Contributor Author

qgib commented Jun 26, 2012

Author Name: James Stott (@jamesstott)


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

@qgib
Copy link
Contributor Author

qgib commented Jun 26, 2012

Author Name: Thomas Arnold (Thomas Arnold)


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.

@qgib
Copy link
Contributor Author

qgib commented Sep 13, 2012

Author Name: Magnus Homann (@homann)


This seems to be applied in master.


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Sep 13, 2012

Author Name: Giovanni Manghi (@gioman)


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.

@qgib
Copy link
Contributor Author

qgib commented May 16, 2013

Author Name: Andre Joost (Andre Joost)


The problem still exists, see #16716 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.


  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented Jun 2, 2013

Author Name: Giovanni Manghi (@gioman)


  • priority_id was changed from High to Severe/Regression

@qgib
Copy link
Contributor Author

qgib commented Jun 2, 2013

Author Name: Giovanni Manghi (@gioman)


  • version was changed from 1.8.0 to master

@qgib
Copy link
Contributor Author

qgib commented Jul 1, 2013

Author Name: Salvatore Larosa (@slarosa)


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 ??

@qgib
Copy link
Contributor Author

qgib commented Jul 1, 2013

Author Name: Regis Haubourg (@haubourg)


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 ;-)

@qgib
Copy link
Contributor Author

qgib commented Jul 12, 2013

Author Name: Vincent Mora (@vmora)


  • assigned_to_id was configured as Vincent Mora

@qgib
Copy link
Contributor Author

qgib commented Jul 12, 2013

Author Name: Vincent Mora (@vmora)


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.

@qgib
Copy link
Contributor Author

qgib commented Jul 12, 2013

Author Name: Giovanni Manghi (@gioman)


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?


  • status_id was changed from Reopened to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jul 12, 2013

Author Name: Giovanni Manghi (@gioman)


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.


  • crashes_corrupts_data was changed from 1 to 0
  • status_id was changed from Feedback to Open
  • priority_id was changed from Severe/Regression to Normal

@qgib
Copy link
Contributor Author

qgib commented Jul 12, 2013

Author Name: Giovanni Manghi (@gioman)


  • subject was 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)

@qgib
Copy link
Contributor Author

qgib commented Jul 12, 2013

Author Name: Vincent Mora (@vmora)


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.

@qgib
Copy link
Contributor Author

qgib commented Jul 12, 2013

Author Name: Giovanni Manghi (@gioman)


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).

@qgib
Copy link
Contributor Author

qgib commented Jul 12, 2013

Author Name: Vincent Mora (@vmora)


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).

@qgib
Copy link
Contributor Author

qgib commented Jul 16, 2013

Author Name: Vincent Mora (@vmora)


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 ?


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jul 17, 2013

Author Name: Giovanni Manghi (@gioman)


Does someone see any reason not to do so ?

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

@qgib
Copy link
Contributor Author

qgib commented Jul 17, 2013

Author Name: Vincent Mora (@vmora)


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:
#747


  • status_id was changed from Feedback to Resolved
  • resolution was changed from to fixed

@qgib
Copy link
Contributor Author

qgib commented Jul 18, 2013

Author Name: Vincent Mora (@vmora)


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


  • assigned_to_id removed Vincent Mora
  • status_id was changed from Resolved to Closed

@qgib
Copy link
Contributor Author

qgib commented Sep 23, 2013

Author Name: Alexandre Neto (@SrNetoChan)


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!


  • 6254 was configured as vegetacao_potencial.zip

@qgib
Copy link
Contributor Author

qgib commented Sep 23, 2013

Author Name: Matthias Kuhn (@m-kuhn)


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.

@qgib
Copy link
Contributor Author

qgib commented Sep 23, 2013

Author Name: Giovanni Manghi (@gioman)


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.

@qgib
Copy link
Contributor Author

qgib commented Jan 18, 2014

Author Name: Giovanni Manghi (@gioman)


see also http://lists.osgeo.org/pipermail/qgis-developer/2014-January/030315.html


  • resolution was changed from fixed to

@qgib
Copy link
Contributor Author

qgib commented Jan 18, 2014

Author Name: Jürgen Fischer (@jef-n)


  • status_id was changed from Closed to Reopened

@qgib
Copy link
Contributor Author

qgib commented Jun 20, 2014

Author Name: Giovanni Manghi (@gioman)


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


  • status_id was changed from Reopened to Closed
  • resolution was changed from to invalid

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Map and Legend Related to map or legend rendering 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! Map and Legend Related to map or legend rendering
Projects
None yet
Development

No branches or pull requests

1 participant