Bug report #10263

Freeze using "Select By Location" (or the spatial query tool) for complex polygon and points

Added by Neil Benny almost 10 years ago. Updated about 5 years ago.

Category:C++ plugins/Spatial Query
Affected QGIS version:3.5(master) Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:18695


Using QGIS 2.2 (tested in current nightly build of 2.3). 32bit version (replicated issue in 64bit version).

QGIS goes slow, then crashes when doing a "select by location" on points inside a polygon when using a very complex polygon. This is an issue with flooding data in the way it is provided by the Scottish Environment Protection Agency (single polygon converted from a raster - very complex - see attached).

I had thought this problem had been solved in the new release, but we have the same issue as laid out before.

The data in the zip file attached seems to cause the problem - it is one of the pieces of flood data and some OSM data (I can't include the original dataset because it is a secure dataset to do with vulnerable people). Both files are in British National Grid 27700.

When the "Select by Location" analysis is run, the window remains open and hangs, it doesn't crash, but it has been left overnight processing and has not completed. When you try and cancel the operation, QGIS crashes entirely.

error_data.zip (955 KB) Neil Benny, 2014-05-14 02:01 AM


#1 Updated by Tobias Schneider almost 10 years ago

In general I think that the current build doesn't like selecting and deselecting polygons. I get a few freezes a day currently just working with polygons and the attribute table. I just can't really pinpoint it at the moment.

#2 Updated by Giovanni Manghi almost 10 years ago

  • Subject changed from Crash using Select By Location for complex polygon and points to Freeze using "Select By Location" (or the spatial query tool) for complex polygon and points
  • Category changed from Vectors to 44
  • Crashes QGIS or corrupts data changed from No to Yes
  • Operating System deleted (Windows)
  • OS version deleted (7)

yes, it seems that using large/complex polygons (like your one that is the result of a poligonization from raster) the tools are largely inefficient. Anyway there are alternatives. In the processing toolbox you can use v.select (with the overlap operator) and the operation takes a few seconds. Also in PostGIS the operation/query takes a few seconds.

#3 Updated by Giovanni Manghi over 9 years ago

still true on the latest master.

#4 Updated by Giovanni Manghi over 7 years ago

  • Category changed from 44 to Processing/QGIS

#5 Updated by Giovanni Manghi about 7 years ago

  • Affected QGIS version changed from master to 2.18.4
  • Category changed from Processing/QGIS to C++ plugins/Spatial Query
  • Target version set to Version 2.18

No improvements whatsoever in QGIS 2.18.4 or master.

#6 Updated by Giovanni Manghi almost 7 years ago

  • Regression? set to No
  • Easy fix? set to No

#7 Updated by Loïc BARTOLETTI about 5 years ago

  • Affected QGIS version changed from 2.18.4 to 3.5(master)
  • Description updated (diff)

Confirmed on master.
I think this is a good case for very complex (and invalid) geometries. By processing the data, we can reduce the time, but not as much as on postgis.

Also available in: Atom PDF