Bug report #1669

ftools: error in select by location

Added by bjpfei - over 11 years ago. Updated over 9 years ago.

Status:Closed
Priority:Low
Assignee:cfarmer -
Category:Python plugins
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:invalid
Crashes QGIS or corrupts data: Copied to github as #:11729

Description

1.) open select by location

2.) choose two db-layers (seems that it doesn't matter if line or polygon

3.) ok

ftools version 0.5.9
You get a python error

"/home/bjsvwpfe/.qgis/python/plugins/fTools/tools/doSelectByLocation.py", line 61, in compute
geomLayer = QgsGeometry(feat.geometry())
TypeError: argument 1 of QgsGeometry() has an invalid type

thx

Associated revisions

Revision 6e48297f
Added by cfarmer - over 10 years ago

Update to select by location tool: should run faster for large layers, and requires less memory. Should also fix #1669

git-svn-id: http://svn.osgeo.org/qgis/trunk/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 67376a6e
Added by cfarmer - over 10 years ago

Update to select by location tool: should run faster for large layers, and requires less memory. Should also fix #1669

git-svn-id: http://svn.osgeo.org/qgis/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#1 Updated by Giovanni Manghi about 11 years ago

I cannot replicate the python error (using ftools 0.5.10) under ubuntu 9.04/win xp and qgis 1.2 but I can produce and replicate qgis freeze using the same "select by location" tool.

Take the qgis sample dataset and pick a polygon layer (ex. grassland) and a line layer (ex. trails and majrivers): if I select features in grassland intersecting features in trails is all ok, if repeat the same but with majrivers instead of trails, than wgis freezes.

#2 Updated by Horst Düster about 11 years ago

The error occurs when you use PostGIS Layer for the analysis. The following error is reported:

Traceback (most recent call last):
  File "/usr/local/qgis-trunk/share/qgis/python/plugins/fTools/tools/doSelectByLocation.py", line 52, in accept
    self.compute(inPoly, inPts, self.cmbModify.currentText())
  File "/usr/local/qgis-trunk/share/qgis/python/plugins/fTools/tools/doSelectByLocation.py", line 64, in compute
    geomLayer = [[QgsGeometry]](feat.geometry())
[[TypeError]]: argument 1 of [[QgsGeometry]]() has an invalid type

#3 Updated by Giovanni Manghi about 11 years ago

Ok, confirmed also this error when using postgis layers:

An error has occured while executing Python code:

Traceback (most recent call last):
  File "/usr/local/share/qgis/python/plugins/fTools/tools/doSelectByLocation.py", line 52, in accept
    self.compute(inPoly, inPts, self.cmbModify.currentText())
  File "/usr/local/share/qgis/python/plugins/fTools/tools/doSelectByLocation.py", line 64, in compute
    geomLayer = [[QgsGeometry]](feat.geometry())
[[TypeError]]: argument 1 of [[QgsGeometry]]() has an invalid type

Python version:
2.6.2 (release26-maint, Apr 19 2009, 02:11:59) 
[GCC 4.3.3]

Python path:['/usr/local/share/qgis/python', '/home/gio/.qgis//python/plugins', '/usr/local/share/qgis/python/plugins', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/var/lib/python-support/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/var/lib/python-support/python2.6/gtk-2.0', '/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode', '/usr/local/lib/python2.6/dist-packages', '/usr/local/share/qgis/python/plugins/fTools/tools']

#4 Updated by Giovanni Manghi over 10 years ago

All this issues are confirmed in the latest trunk qgis code.

#5 Updated by cfarmer - over 10 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Should be fixed in 67376a6e (SVN r13206)

-Carson

#6 Updated by bderstine - over 9 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (fixed)

I seem to be getting a similar error when running on two very large polygon vector shapefiles (select features in a layer with 820,154 small footprint records, that intersect features in a layer with 7,766 large footprint records).
using fTools 0.5.10, qGIS 1.6.0:

An error has occured while executing Python code:

Traceback (most recent call last):
File "C:\\QUANTU~1\\apps\\qgis\\python\\plugins\\fTools\\tools\\doSelectByLocation.py", line 53, in accept
self.compute(inPoly, inPts, self.cmbModify.currentText())
File "C:\\QUANTU~1\\apps\\qgis\\python\\plugins\\fTools\\tools\\doSelectByLocation.py", line 78, in compute
print len(intersects)
IOError: [Errno 9] Bad file descriptor

Python version:
2.5.2 (c5cd2930 (SVN r253):60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]

#7 Updated by cfarmer - over 9 years ago

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

Replying to [comment:7 bderstine]:

I seem to be getting a similar error when running on two very large polygon vector shapefiles:
IOError: [Errno 9] Bad file descriptor

The above error is not related to the previously posted error, this 'new error' is a Windows IO problem that we have encountered before. This being the case, this issue has also already been resolved in trunk. Please ensure that you are in fact using the latest version of QGIS, and also the latest version of fTools (which is in fact the one installed by default). Looking at the source for the "select by location" tool, the offending print statement is no longer there in recent versions.

-Carson

#8 Updated by bderstine - over 9 years ago

Carson, thanks for the response. I was using the Standalone Installer of release 1.6.0, but have now switched to the OSGeo4W Installer using the qgis-dev package in order to get the nightly builds of trunk. It works great.

Also available in: Atom PDF