Opened 15 years ago

Closed 13 years ago

Last modified 13 years ago

#1669 closed bug (invalid)

ftools: error in select by location

Reported by: bjpfei Owned by: cfarmer
Priority: major: does not work as expected Milestone: Version 1.5.0
Component: Python plugins and bindings Version: Trunk
Keywords: select by location Cc: pcav
Must Fix for Release: Yes Platform: All
Platform Version: Windows 7 Awaiting user input: no

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

Change History (9)

comment:1 by lutra, 15 years ago

Cc: pcav added
Milestone: Version 1.0.3Version 1.2.0
Owner: changed from nobody to cfarmer

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.

comment:2 by hdus, 15 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

comment:3 by lutra, 15 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']

comment:4 by pcav, 15 years ago

Component: C++ PluginsPython plugins and bindings

comment:5 by lutra, 14 years ago

Platform: RedHatAll

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

comment:6 by cfarmer, 14 years ago

Resolution: fixed
Status: newclosed

Should be fixed in r13205

-Carson

comment:7 by bderstine, 13 years ago

Keywords: select by location added
Platform Version: Windows 7
Resolution: fixed
Status: closedreopened

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 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]

in reply to:  7 comment:8 by cfarmer, 13 years ago

Resolution: invalid
Status: reopenedclosed

Replying to 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

comment:9 by bderstine, 13 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.

Note: See TracTickets for help on using tickets.